* @static
*/
function browse() {
+ CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
$groupParams = array('name' => self::$_gName);
$optionValue = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'component_id,weight');
// retrieve financial account name for the payment instrument page
if ($gName = "payment_instrument") {
foreach ($optionValue as $key => $option) {
- $optionValue[$key]['financial_account'] = CRM_Financial_BAO_FinancialTypeAccount::getFinancialAccount($key, 'civicrm_option_value'); }
+ $optionValue[$key]['financial_account'] = CRM_Financial_BAO_FinancialTypeAccount::getFinancialAccount($key, 'civicrm_option_value');
+ }
}
-
+ $this->assign('includeWysiwygEditor', TRUE);
$this->assign('rows', $optionValue);
}
$this->assign('editor', $editor);
// include wysiwyg editor js files
+ // FIXME: This code does not make any sense
$includeWysiwygEditor = FALSE;
$includeWysiwygEditor = $this->get('includeWysiwygEditor');
if (!$includeWysiwygEditor) {
$this->preview($id);
}
else {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Custom/Page/Field.js');
+ CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
$this->browse();
}
// http://civicrm.org/licensing
+// Adds ajaxy behavior to a simple CiviCRM page
cj(function($) {
$('#crm-main-content-wrapper')
// Widgetize the content area
- .crmSnippet({block: false})
+ .crmSnippet()
// Open action links in a popup
- .on('click', 'a.action-item:not(".enable-action, .disable-action")', function() {
- CRM.loadForm(this.href).on('crmFormSuccess', function(e, data) {
+ .on('click', 'a.button, a.action-item:not(".enable-action, .disable-action")', function() {
+ CRM.loadForm($(this).attr('href'), {
+ openInline: 'a'
+ }).on('crmFormSuccess', function(e, data) {
// Refresh page when form completes
$('#crm-main-content-wrapper').crmSnippet('refresh');
});