* settings/MemberDashboard.setting.php: New file.
* CRM/Memberdashboard/Page/Info.php (CRM_Memberdashboard_Page_Info.run):
Fetch member info profile and pass it to the client.
* assets/js/member-info.js: Load the configured profile instead of a
hardcoded one.
* README.org (Configuration): New section.
class CRM_Memberdashboard_Page_Info extends CRM_Core_Page {
function run() {
CRM_Utils_System::setTitle('My Info');
- CRM_Core_Resources::singleton()->addScriptFile('org.fsf.memberdashboard',
- 'assets/js/underscore.js');
- CRM_Core_Resources::singleton()->addScriptFile('org.fsf.memberdashboard',
- 'assets/js/member-info.js');
+
+ $profile_id = civicrm_api3('setting', 'getvalue', array(
+ 'name' => 'memberdashboard_info_profile_id',
+ 'group' => 'Member Dashboard Preferences'
+ ));
+
+ $resources = CRM_Core_Resources::singleton();
+ $resources->addScriptFile('org.fsf.memberdashboard',
+ 'assets/js/underscore.js');
+ $resources->addScriptFile('org.fsf.memberdashboard',
+ 'assets/js/member-info.js');
+ $resources->addScript("var memberDashboard = { profileId: $profile_id };");
parent::run();
}
This CiviCRM extension provides a custom user interface for FSF
associate members to manage their account information.
+Configuration
+-------------
+
+### Set the member settings profile
+
+```
+drush civicrm-api setting.create memberdashboard_info_profile_id=<profile-id>
+```
+
+
Copyright
---------
}
$(document).ready(function() {
- loadProfile(1, renderProfile);
+ loadProfile(memberDashboard.profile_id, renderProfile);
});
})(jQuery);
--- /dev/null
+<?php
+/**
+ * FSF Member Dashboard
+ * Copyright © 2014 Free Software Foundation, Inc.
+ *
+ * This file is a part of FSF Member Dashboard.
+ *
+ * FSF Member Dashboard is free software; you can copy, modify, and
+ * distribute it under the terms of the GNU Affero General Public
+ * License Version 3, 19 November 2007 and the CiviCRM Licensing
+ * Exception.
+ *
+ * FSF Member Dashboard is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FSF Member Dashboard. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+return array(
+ 'memberdashboard_info_profile_id' => array(
+ 'group_name' => 'Member Dashboard Preferences',
+ 'group' => 'memberdashboard',
+ 'name' => 'memberdashboard_info_profile_id',
+ 'type' => 'Integer',
+ 'default' => 1,
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => 'Info Profile ID',
+ 'help_text' => 'Profile ID for member-editable contact information'
+ )
+);
\ No newline at end of file