Author: jablko
Date: Sun Oct 17 17:34:16 2010
New Revision: 8204
Log:
Use ->setNameFormat()
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php
Sun Oct 17 17:16:55 2010 (r8203)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedAuthorityRecordsComponent.class.php
Sun Oct 17 17:34:16 2010 (r8204)
@@ -22,26 +22,26 @@
// Arrays not allowed in class constants
public static
$NAMES = array(
- 'relatedEntity[object]',
- 'relatedEntity[description]',
- 'relatedEntity[startDate]',
- 'relatedEntity[endDate]',
- 'relatedEntity[dateDisplay]');
+ 'object',
+ 'description',
+ 'startDate',
+ 'endDate',
+ 'dateDisplay');
protected function addField($name)
{
switch ($name)
{
- case 'relatedEntity[object]':
- case 'relatedEntity[startDate]':
- case 'relatedEntity[endDate]':
- case 'relatedEntity[dateDisplay]':
+ case 'object':
+ case 'startDate':
+ case 'endDate':
+ case 'dateDisplay':
$this->form->setValidator($name, new sfValidatorString);
$this->form->setWidget($name, new sfWidgetFormInput);
break;
- case 'relatedEntity[description]':
+ case 'description':
$this->form->setValidator($name, new sfValidatorString);
$this->form->setWidget($name, new sfWidgetFormTextarea);
@@ -63,6 +63,8 @@
{
parent::execute($request);
+
$this->form->getWidgetSchema()->setNameFormat('relatedAuthorityRecords[%s]');
+
// Get actors (object) related to this function (subject)
$criteria = new Criteria;
$criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php
Sun Oct 17 17:16:55 2010 (r8203)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedFunctionsComponent.class.php
Sun Oct 17 17:34:16 2010 (r8204)
@@ -22,18 +22,18 @@
// Arrays not allowed in class constants
public static
$NAMES = array(
- 'relation[authorizedFormOfName]',
- 'relation[category]',
- 'relation[description]',
- 'relation[startDate]',
- 'relation[endDate]',
- 'relation[dateDisplay]');
+ 'authorizedFormOfName',
+ 'category',
+ 'description',
+ 'startDate',
+ 'endDate',
+ 'dateDisplay');
protected function addField($name)
{
switch ($name)
{
- case 'relation[authorizedFormOfName]':
+ case 'authorizedFormOfName':
$choices = array();
$this->form->setValidator($name, new sfValidatorString);
@@ -41,7 +41,7 @@
break;
- case 'relation[category]':
+ case 'category':
$this->form->setValidator($name, new sfValidatorString);
$choices = array();
@@ -56,15 +56,15 @@
break;
- case 'relation[startDate]':
- case 'relation[endDate]':
- case 'relation[dateDisplay]':
+ case 'startDate':
+ case 'endDate':
+ case 'dateDisplay':
$this->form->setValidator($name, new sfValidatorString);
$this->form->setWidget($name, new sfWidgetFormInput);
break;
- case 'relation[description]':
+ case 'description':
$this->form->setValidator($name, new sfValidatorString);
$this->form->setWidget($name, new sfWidgetFormTextarea);
@@ -86,6 +86,8 @@
{
parent::execute($request);
+ $this->form->getWidgetSchema()->setNameFormat('relatedFunction[%s]');
+
// Find function to function relations with current function as subject or
// object
$criteria = new Criteria;
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php
Sun Oct 17 17:16:55 2010 (r8203)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/actions/relatedResourcesComponent.class.php
Sun Oct 17 17:34:16 2010 (r8204)
@@ -22,17 +22,17 @@
// Arrays not allowed in class constants
public static
$NAMES = array(
- 'relatedResource[object]',
- 'relatedResource[description]',
- 'relatedResource[startDate]',
- 'relatedResource[endDate]',
- 'relatedResource[dateDisplay]');
+ 'object',
+ 'description',
+ 'startDate',
+ 'endDate',
+ 'dateDisplay');
protected function addField($name)
{
switch ($name)
{
- case 'relatedResource[object]':
+ case 'object':
$choices = array();
$this->form->setValidator($name, new sfValidatorString);
@@ -40,15 +40,15 @@
break;
- case 'relatedResource[startDate]':
- case 'relatedResource[endDate]':
- case 'relatedResource[dateDisplay]':
+ case 'startDate':
+ case 'endDate':
+ case 'dateDisplay':
$this->form->setValidator($name, new sfValidatorString);
$this->form->setWidget($name, new sfWidgetFormInput);
break;
- case 'relatedResource[description]':
+ case 'description':
$this->form->setValidator($name, new sfValidatorString);
$this->form->setWidget($name, new sfWidgetFormTextarea);
@@ -70,6 +70,8 @@
{
parent::execute($request);
+ $this->form->getWidgetSchema()->setNameFormat('relatedResource[%s]');
+
// Get information objects (object) related to this function (subject)
$criteria = new Criteria;
$criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php
Sun Oct 17 17:16:55 2010 (r8203)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedAuthorityRecords.php
Sun Oct 17 17:34:16 2010 (r8204)
@@ -87,59 +87,59 @@
</caption><tbody>
<tr>
<th colspan="4">
- <?php echo $form['relatedEntity[object]']
+ <?php echo $form->object
->label(__('Authorized form of name'))
->renderLabel() ?>
</th>
</tr><tr>
<td colspan="4">
- <?php echo $form['relatedEntity[object]']->render(array('class' =>
'form-autocomplete')) ?>
+ <?php echo $form->object->render(array('class' =>
'form-autocomplete')) ?>
<input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'actor', 'action' => 'autocomplete', 'showOnlyActors'
=> 'true')) ?>"/>
- <?php echo $form['relatedEntity[object]']
+ <?php echo $form->object
->help(__('Select the name from the drop-down menu; enter the
identifier or the first few letters to narrow the choices. (ISDF 6.1)'))
->renderHelp() ?>
</td>
</tr><tr>
<th colspan="4">
- <?php echo $form['relatedEntity[description]']
+ <?php echo $form->description
->label(__('Nature of relationship'))
->renderLabel() ?>
</th>
</tr><tr>
<td colspan="4">
- <?php echo $form['relatedEntity[description]'] ?>
- <?php echo $form['relatedEntity[description]']
+ <?php echo $form->description ?>
+ <?php echo $form->description
->help(__('Describe the nature of the relationship between the
function and the related authority record. (ISDF 6.2)'))
->renderHelp() ?>
</td>
</tr><tr>
<th style="width: 25%">
- <?php echo $form['relatedEntity[startDate]']
+ <?php echo $form->startDate
->label(__('Date†'))
->renderLabel() ?>
</th><th style="width: 25%">
- <?php echo $form['relatedEntity[endDate]']
+ <?php echo $form->endDate
->label(__('End date†'))
->renderLabel() ?>
</th><th colspan="2" style="width: 50%">
- <?php echo $form['relatedEntity[dateDisplay]']
+ <?php echo $form->dateDisplay
->label(__('Date display†'))
->renderLabel() ?>
</th>
</tr><tr>
<td style="width: 25%">
- <?php echo $form['relatedEntity[startDate]'] ?>
- <?php echo $form['relatedEntity[startDate]']
+ <?php echo $form->startDate ?>
+ <?php echo $form->startDate
->help(__('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'))
->renderHelp() ?>
</td><td style="width: 25%">
- <?php echo $form['relatedEntity[endDate]'] ?>
- <?php echo $form['relatedEntity[endDate]']
+ <?php echo $form->endDate ?>
+ <?php echo $form->endDate
->help(__('Enter the end year. Do not use any qualifiers or
typographical symbols to express uncertainty. If the start and end years are
the same, enter data only in the "Date" field and leave the "End date" blank.'))
->renderHelp() ?>
</td><td colspan="2" style="width: 50%">
- <?php echo $form['relatedEntity[dateDisplay]'] ?>
- <?php echo $form['relatedEntity[dateDisplay]']
+ <?php echo $form->dateDisplay ?>
+ <?php echo $form->dateDisplay
->help(__('"Record, when relevant, the start and the end date of the
relationship." (ISDF 6.3) Enter the date as you would like it to appear in the
show page for the function, using qualifiers and/or typographical symbols to
express uncertainty if desired.'))
->renderHelp() ?>
</td>
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php
Sun Oct 17 17:16:55 2010 (r8203)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedFunctions.php
Sun Oct 17 17:34:16 2010 (r8204)
@@ -168,72 +168,72 @@
</caption><tbody>
<tr>
<th colspan="4">
- <?php echo $form['relation[authorizedFormOfName]']
+ <?php echo $form->authorizedFormOfName
->label(__('Authorized form of name'))
->renderLabel() ?>
</th>
</tr><tr>
<td colspan="4">
- <?php echo
$form['relation[authorizedFormOfName]']->render(array('class' =>
'form-autocomplete')) ?>
+ <?php echo $form->authorizedFormOfName->render(array('class' =>
'form-autocomplete')) ?>
<input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'function', 'action' => 'autocomplete')) ?>"/>
- <?php echo $form['relation[authorizedFormOfName]']
+ <?php echo $form->authorizedFormOfName
->help(__('"Record the authorised form of name and any unique
identifier of the related function." (ISDF 5.3.1)'))
->renderHelp() ?>
</td>
</tr><tr>
<th colspan="4">
- <?php echo $form['relation[category]']
+ <?php echo $form->category
->label(__('Category'))
->renderLabel() ?>
</th>
</tr><tr>
<td colspan="4">
- <?php echo $form['relation[category]'] ?>
- <?php echo $form['relation[category]']
+ <?php echo $form->category ?>
+ <?php echo $form->category
->help(__('"Record a general category into which the relationship
being described falls." (ISDF 5.3.2) Select a category from the drop-down menu:
hierarchical, temporal or associative.'))
->renderHelp() ?>
</td>
</tr><tr>
<th colspan="4">
- <?php echo $form['relation[description]']
+ <?php echo $form->description
->label(__('Description'))
->renderLabel() ?>
</th>
</tr><tr>
<td colspan="4">
- <?php echo $form['relation[description]'] ?>
- <?php echo $form['relation[description]']
+ <?php echo $form->description ?>
+ <?php echo $form->description
->help(__('"Record a precise description of the nature of the
relationship between the function being described and the related function."
(ISDF 5.3.3) Note that the text entered in this field will also appear in the
related function.'))
->renderHelp() ?>
</td>
</tr><tr>
<th style="width: 25%">
- <?php echo $form['relation[startDate]']
+ <?php echo $form->startDate
->label('Date†')
->renderLabel() ?>
</th><th style="width: 25%">
- <?php echo $form['relation[endDate]']
+ <?php echo $form->endDate
->label('End date†')
->renderLabel() ?>
</th><th colspan="2" style="width: 50%">
- <?php echo $form['relation[dateDisplay]']
+ <?php echo $form->dateDisplay
->label('Date display†')
->renderLabel() ?>
</th>
</tr><tr>
<td style="width: 25%">
- <?php echo $form['relation[startDate]'] ?>
- <?php echo $form['relation[startDate]']
+ <?php echo $form->startDate ?>
+ <?php echo $form->startDate
->help(__('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'))
->renderHelp() ?>
</td><td style="width: 25%">
- <?php echo $form['relation[endDate]'] ?>
- <?php echo $form['relation[endDate]']
+ <?php echo $form->endDate ?>
+ <?php echo $form->endDate
->help(__('Enter the end year. Do not use any qualifiers or
typographical symbols to express uncertainty. If the start and end years are
the same, enter data only in the "Date" field and leave the "End date" blank.'))
->renderHelp() ?>
</td><td colspan="2" style="width: 50%">
- <?php echo $form['relation[dateDisplay]'] ?>
- <?php echo $form['relation[dateDisplay]']
+ <?php echo $form->dateDisplay ?>
+ <?php echo $form->dateDisplay
->help(__('"Record the start and, when relevant, the end date of the
relationship." (ISDF 5.3.4) Enter the date as you would like it to appear in
the show page for the function, using qualifiers and/or typographical symbols
to express uncertainty if desired.'))
->renderHelp() ?>
</td>
Modified:
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php
==============================================================================
---
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php
Sun Oct 17 17:16:55 2010 (r8203)
+++
trunk/plugins/sfIsdfPlugin/modules/sfIsdfPlugin/templates/_relatedResources.php
Sun Oct 17 17:34:16 2010 (r8204)
@@ -87,59 +87,59 @@
</caption><tbody>
<tr>
<th colspan="4">
- <?php echo $form['relatedResource[object]']
+ <?php echo $form->object
->label(__('Title'))
->renderLabel() ?>
</th>
</tr><tr>
<td colspan="4">
- <?php echo $form['relatedResource[object]']->render(array('class' =>
'form-autocomplete')) ?>
+ <?php echo $form->object->render(array('class' =>
'form-autocomplete')) ?>
<input class="list" type="hidden" value="<?php echo
url_for(array('module' => 'informationobject', 'action' => 'autocomplete'))
?>"/>
- <?php echo $form['relatedResource[object]']
+ <?php echo $form->object
->help(__('Select the title from the drop-down menu; enter the
identifier or the first few letters to narrow the choices. (ISDF 6.1)'))
->renderHelp() ?>
</td>
</tr><tr>
<th colspan="4">
- <?php echo $form['relatedResource[description]']
+ <?php echo $form->description
->label(__('Nature of relationship'))
->renderLabel() ?>
</th>
</tr><tr>
<td colspan="4">
- <?php echo $form['relatedResource[description]'] ?>
- <?php echo $form['relatedResource[description]']
+ <?php echo $form->description ?>
+ <?php echo $form->description
->help(__('Describe the nature of the relationship between the
function and the related resource. (ISDF 6.2)'))
->renderHelp() ?>
</td>
</tr><tr>
<th style="width: 25%">
- <?php echo $form['relatedResource[startDate]']
+ <?php echo $form->startDate
->label(__('Date†'))
->renderLabel() ?>
</th><th style="width: 25%">
- <?php echo $form['relatedResource[endDate]']
+ <?php echo $form->endDate
->label(__('End date†'))
->renderLabel() ?>
</th><th colspan="2" style="width: 50%">
- <?php echo $form['relatedResource[dateDisplay]']
+ <?php echo $form->dateDisplay
->label(__('Date display†'))
->renderLabel() ?>
</th>
</tr><tr>
<td style="width: 25%">
- <?php echo $form['relatedResource[startDate]'] ?>
- <?php echo $form['relatedResource[startDate]']
+ <?php echo $form->startDate ?>
+ <?php echo $form->startDate
->help(__('Enter the start year. Do not use any qualifiers or
typographical symbols to express uncertainty.'))
->renderHelp() ?>
</td><td style="width: 25%">
- <?php echo $form['relatedResource[endDate]'] ?>
- <?php echo $form['relatedResource[endDate]']
+ <?php echo $form->endDate ?>
+ <?php echo $form->endDate
->help(__('Enter the end year. Do not use any qualifiers or
typographical symbols to express uncertainty. If the start and end years are
the same, enter data only in the "Date" field and leave the "End date" blank.'))
->renderHelp() ?>
</td><td colspan="2" style="width: 50%">
- <?php echo $form['relatedResource[dateDisplay]'] ?>
- <?php echo $form['relatedResource[dateDisplay]']
+ <?php echo $form->dateDisplay ?>
+ <?php echo $form->dateDisplay
->help(__('"Record, when relevant, the start and the end date of the
relationship." (ISDF 6.3) Enter the date as you would like it to appear in the
show page for the function, using qualifiers and/or typographical symbols to
express uncertainty if desired.'))
->renderHelp() ?>
</td>
--
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.com/group/qubit-commits?hl=en.