From 8e8a3d8143f30afee081dc321ca8cfa9e23395d9 Mon Sep 17 00:00:00 2001 From: mzd Date: Tue, 29 Apr 2014 20:10:25 -0400 Subject: [PATCH] add doc-block; remove dev-detritus; add argument to override configs to addProfileSelector --- CRM/Event/Form/ManageEvent/Registration.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 041d4f1938..650b71a73f 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -323,7 +323,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent // explicit height and width. $form->addWysiwyg('footer_text', ts('Footer Text'), array('rows' => 2, 'cols' => 40)); - extract( $this->getProfileSelectorTypes() ); /*var_dump($profileEntities); var_dump($allowCoreTypes); var_dump($allowSubTypes); */ + extract( $this->getProfileSelectorTypes() ); $form->addProfileSelector( 'custom_pre_id', ts('Include Profile') . '
' . ts('(top of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities); $form->addProfileSelector( 'custom_post_id', ts('Include Profile') . '
' . ts('(bottom of page)'), $allowCoreTypes, $allowSubTypes, $profileEntities); @@ -332,12 +332,27 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $form->addProfileSelector( 'additional_custom_post_id', ts('Profile for Additional Participants') . '
' . ts('(bottom of page)'), $allowCoreTypes, $allowSubTypes, $profileEntitites); } - function buildMultipleProfileBottom(&$form, $count, $prefix = '', $name = 'Include Profile') { - extract( $this->getProfileSelectorTypes() ); + /** + * Subroutine to insert a Profile Editor widget + * depends on getProfileSelectorTypes + * + * @param array &$form + * @param int $count unique index + * @param string $prefix dom element ID prefix + * @param string $name dom element name + * @param array $configs Optional, for addProfileSelector(), defaults to using getProfileSelectorTypes() + **/ + function buildMultipleProfileBottom(&$form, $count, $prefix = '', $name = 'Include Profile', $configs = null) { + extract( ( is_null($configs) ) ? $this->getProfileSelectorTypes() : $configs ); $element = $prefix . "custom_post_id_multiple[$count]"; $form->addProfileSelector( $element, $name . '
' . ts('(bottom of page)'), $allowCoreTypes, $allowSubTypes, $profileEntitites); } + /** + * Create initializers for addprofileSelector + * + * @return array( 'allowCoreTypes' => array(), 'allowSubTypes' => array(), 'profileEntities' => array() ) + **/ function getProfileSelectorTypes() { $configs = array( 'allowCoreTypes' => array(), -- 2.25.1