Update the controller in admin to return output as string if needed.
* @return void
* @access public
*/
- public function controller ($menuItem, $action = false, $actionData = false)
+ public function controller( $menuItem, $action = false, $actionData = false, $returnOutput = false )
{
// Enque admin scripts and css here so that only happens when we're doing something
$smarty->template->addTemplateDir($viewPath);
// Generate output from model data and view
- $smarty->template->display($viewFile);
+ if ( $returnOutput ) {
+ $output = $smarty->template->fetch( $viewFile );
+ } else {
+ $smarty->template->display( $viewFile );
+ }
// If debug is requested, create debug window
if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
// Restore timezone that was set before our code was called
date_default_timezone_set($defaultTimeZone);
+ if ( $returnOutput ) {
+ return $output;
+ }
+
}
}
*/
public function modelAction ($actionData = false)
{
-
- $templateData = array('haveImageArray' => false);
+ $templateData = array(
+ 'haveImageArray' => false,
+ 'thisOption' => '',
+ );
$imageBaseURL = get_option( 'glm-member-db-import-imageurl', false );
$image = get_option( 'glm-member-db-import-image', false );
require GLM_MEMBERS_PLUGIN_PATH.'/models/admin/management/import/brewbakersBrands.php';
break;
- default:
+ case 'customfields':
+ $requestedView = 'custom.html';
+ $templateData['content'] = apply_filters( 'glm-members-customfields-edit', '', 'members' );
+ $templateData['thisOption'] = $option;
+ break;
+ default:
break;
}
--- /dev/null
+{include file='admin/management/header.html'}
+{include file='admin/management/memberHeader.html'}
+
+{$content}
+
+{include file='admin/footer.html'}
{include file='admin/management/header.html'}
+{include file='admin/management/memberHeader.html'}
+
<h2>Data Import Step 1: Supply database access information.</h2>
{if isset($genError)}
<p>
--- /dev/null
+<h2 class="nav-tab-wrapper">
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=import" class="nav-tab{if $thisOption == ''} nav-tab-active{/if}">Import Members</a>
+ {if apply_filters( 'glm-members-customfields-active', false )}
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=import&option=customfields" class="nav-tab{if $thisOption == 'customfields'} nav-tab-active{/if}">Custom Fields</a>
+ {/if}
+</h2>
+