Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
civicrm/admin/flexmailer - Add settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Apr 30, 2019
1 parent bf4b065 commit 7d545f1
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 9 deletions.
23 changes: 23 additions & 0 deletions CRM/Flexmailer/Form/FlexmailerAdmin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

// use CRM_Flexmailer_ExtensionUtil as E;

/**
* Form controller class
*
* @see https://wiki.civicrm.org/confluence/display/CRMDOC/QuickForm+Reference
*/
class CRM_Flexmailer_Form_FlexmailerAdmin extends CRM_Admin_Form_Setting {

protected $_settings = array(
'flexmailer_traditional' => 'Flexmailer Preferences',
);

/**
* Build the form object.
*/
public function buildQuickForm() {
parent::buildQuickForm();
}

}
19 changes: 10 additions & 9 deletions flexmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,19 @@ function flexmailer_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
* Implements hook_civicrm_navigationMenu().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu
*
*/
function flexmailer_civicrm_navigationMenu(&$menu) {
_flexmailer_civix_insert_navigation_menu($menu, NULL, array(
'label' => ts('The Page', array('domain' => 'org.civicrm.flexmailer')),
'name' => 'the_page',
'url' => 'civicrm/the-page',
'permission' => 'access CiviReport,access CiviContribute',
'operator' => 'OR',
_flexmailer_civix_insert_navigation_menu($menu, 'Administer/CiviMail', [
'label' => ts('Flexmailer Settings', array('domain' => 'org.civicrm.flexmailer')),
'name' => 'flexmailer_settings',
'permission' => 'administer CiviCRM',
'child' => array(),
'operator' => 'AND',
'separator' => 0,
));
'url' => CRM_Utils_System::url('civicrm/admin/flexmailer', 'reset=1', TRUE),
]);
_flexmailer_civix_navigationMenu($menu);
} // */
}

/**
* Implements hook_civicrm_alterMenu().
Expand Down
20 changes: 20 additions & 0 deletions templates/CRM/Flexmailer/Form/FlexmailerAdmin.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{crmScope extensionKey='org.civicrm.flexmailer'}
<div class="crm-block crm-form-block crm-flexmailer-form-block">
{*<div class="help">*}
{*{ts}...{/ts} {docURL page="Debugging for developers" resource="wiki"}*}
{*</div>*}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout">
<tr class="crm-flexmailer-form-block-flexmailer_traditional">
<td class="label">{$form.flexmailer_traditional.label}</td>
<td>{$form.flexmailer_traditional.html}<br />
<span class="description">
{ts}For greater backward-compatibility, process "<code>traditional</code>" mailings with the CiviMail's hard-coded BAO.{/ts}<br/>
{ts}For greater forward-compatibility, process "<code>traditional</code>" mailings with Flexmailer's extensible pipeline.{/ts}<br/>
</span>
</td>
</tr>
</table>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
</div>
{/crmScope}
11 changes: 11 additions & 0 deletions xml/Menu/flexmailer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<menu>
<item>
<path>civicrm/admin/flexmailer</path>
<page_callback>CRM_Flexmailer_Form_FlexmailerAdmin</page_callback>
<title>Flexmailer Settings</title>
<adminGroup>CiviMail</adminGroup>
<icon>admin/small/Profile.png</icon>
<access_arguments>administer CiviCRM</access_arguments>
</item>
</menu>

0 comments on commit 7d545f1

Please sign in to comment.