public function buildQuickForm() {
$this->add('select', 'memberdashboard_info_profile_id',
'Member Info Profile', $this->fetchProfiles());
+ $this->add('text', 'memberdashboard_button_static_url',
+ 'Member Button Static Image URL');
$this->add('text', 'memberdashboard_button_api_url',
'Member Button API URL');
$this->add('text', 'memberdashboard_button_api_user',
public function postProcess() {
$params = $this->exportValues();
$profileKey = 'memberdashboard_info_profile_id';
- $urlKey = 'memberdashboard_button_api_url';
+ $staticUrlKey = 'memberdashboard_button_static_url';
+ $apiUrlKey = 'memberdashboard_button_api_url';
$userKey = 'memberdashboard_button_api_user';
$passwordKey = 'memberdashboard_button_api_password';
civicrm_api3('setting', 'create', array(
$profileKey => $params[$profileKey],
- $urlKey => $params[$urlKey],
+ $staticUrlKey => $params[$staticUrlKey],
+ $apiUrlKey => $params[$apiUrlKey],
$userKey => $params[$userKey],
$passwordKey => $params[$passwordKey]
));
}
$emailAliases = $this->loadEmailAliases();
+ $buttonUrl = civicrm_api3('setting', 'getvalue', array(
+ 'name' => 'memberdashboard_button_static_url',
+ 'group' => MEMBERDASHBOARD_SETTINGS_GROUP
+ ));
CRM_Utils_System::setTitle(ts('Benefits'));
+ $this->assign('contact', $this->contact);
$this->assign('user', $user);
$this->assign('emailAliases', $emailAliases);
$this->assign('hasValidMembership', $this->hasValidMembership());
+ $this->assign('buttonUrl', $buttonUrl);
parent::run();
}
'description' => 'Info Profile ID',
'help_text' => 'Profile ID for member-editable contact information'
),
+ 'memberdashboard_button_static_url' => array(
+ 'group_name' => 'Member Dashboard Preferences',
+ 'group' => 'memberdashboard',
+ 'name' => 'memberdashboard_button_static_url',
+ 'type' => 'String',
+ 'default' => '',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Member button static image directory URL',
+ 'help_text' => 'The location of the member button static image files'
+ ),
'memberdashboard_button_api_url' => array(
'group_name' => 'Member Dashboard Preferences',
'group' => 'memberdashboard',
{$form.memberdashboard_info_profile_id.html}
</td>
</tr>
+ <tr>
+ <td class="label">
+ {$form.memberdashboard_button_static_url.label}
+ </td>
+ <td>
+ {$form.memberdashboard_button_static_url.html}
+ </td>
+ </tr>
<tr>
<td class="label">
{$form.memberdashboard_button_api_url.label}
<input class="crm-form-submit default" type="submit" value="Add" />
</form>
+ {if !empty($buttonUrl) }
+ <div class="header-dark">Member button</div>
+
+ <p>
+ Display this member button proudly on your website to show how
+ long you have been an FSF member!
+ </p>
+
+ <div width="1000px">
+ <div style="margin: 0 auto;">
+ <img style="width:182px" src="{$buttonUrl}{$contact.id}.png" />
+ </div>
+ </div>
+ {/if}
+
<div class="header-dark">Member Forums</div>
<p>