Beispiel #1
0
    $customField = new MM_CustomField($item->id);
    // Actions
    $editActionUrl = 'onclick="mmjs.edit(\'mm-custom-fields-dialog\', \'' . $customField->getId() . '\', 475, 335)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $customField->getId() . '\')"';
    $actions = MM_Utils::getEditIcon("Edit Custom Field", '', $editActionUrl);
    if (!MM_CustomField::isBeingUsed($customField->getId())) {
        $actions .= MM_Utils::getDeleteIcon("Delete Custom Field", 'margin-left:5px;', $deleteActionUrl);
    } else {
        $actions .= MM_Utils::getDeleteIcon("This custom field is currently being used and cannot be deleted", 'margin-left:5px;', '', true);
    }
    if ($item->show_on_my_account) {
        $myAcctPage = MM_Utils::getCheckIcon("Show on My Account Page");
    } else {
        $myAcctPage = MM_Utils::getCrossIcon("Hide on My Account Page");
    }
    $smartTags = '<a title="Show Form SmartTag" onclick="mmjs.showCheckoutFormSmartTags(' . $customField->getId() . ',\'' . addslashes($customField->getDisplayName()) . '\')" class="mm-ui-button" style="margin:0px;">' . MM_Utils::getIcon('tag', '', '1.2em', '1px', '', 'margin-right:0px;') . '</a>';
    $rows[] = array(array('content' => "<span title='ID [" . $customField->getId() . "]'>" . $customField->getDisplayName() . "</span>"), array('content' => MM_CustomField::getFieldTypeName($item->type)), array('content' => $myAcctPage), array('content' => $smartTags), array('content' => $actions));
}
$headers = array('name' => array('content' => 'Name'), 'type' => array('content' => 'Type', "attr" => "style='width:110px;'"), 'show_on_my_account' => array('content' => 'My Account Page', "attr" => "style='width:125px;'"), '' => array('content' => 'Form SmartTag', "attr" => "style='width:145px;'"), 'actions' => array('content' => 'Actions', "attr" => "style='width:60px;'"));
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dataGrid->width = "750px";
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><i>No custom fields.</i></p>";
}
?>
<div class="mm-wrap">
	<div class="mm-button-container">
		<a onclick="mmjs.create('mm-custom-fields-dialog', 475, 335)" class="mm-ui-button green"><?php 
echo MM_Utils::getIcon('plus-circle', '', '1.2em', '1px');
Beispiel #2
0
if ($doRenderForm) {
    $showOnMyAccountChecked = $customField->showOnMyAccount() == true ? "checked" : "";
    ?>
	<div id="mm-form-container">
	<input type='hidden' id='mm-id' value='<?php 
    echo $customField->getId();
    ?>
' />
	<table width='95%' cellpadding="6">
	<tr>
		<td style="vertical-align:middle;">
			Name
		</td>
		<td>
			<input type='text' id='mm-display-name' value='<?php 
    echo $customField->getDisplayName();
    ?>
'  style='width: 225px;'  />
		</td>
	</tr>
	<tr>
		<td></td>
		<td>
			<label>
				<input type='checkbox' id='mm-show-on-my-account-cb' <?php 
    echo $showOnMyAccountChecked;
    ?>
 onchange="mmjs.showOnMyAccountChanged()" />
				Show on My Account Page
			</label>
			
Beispiel #3
0
$dataGrid->recordName = "member";
// define datagrid headers
$headers = array('last_name' => array('content' => '<a onclick="mmjs.sort(\'last_name\');" href="#">Name</a>'), 'user_email' => array('content' => '<a onclick="mmjs.sort(\'user_email\');" href="#">Email</a>'), 'phone' => array('content' => '<a onclick="mmjs.sort(\'phone\');" href="#">Phone</a>'), 'membership_level_id' => array('content' => '<a onclick="mmjs.sort(\'membership_level_id\');" href="#">Membership Level</a>'), 'bundles' => array('content' => 'Bundles'));
if ($useCustomField) {
    $field = new MM_CustomField($_REQUEST["mm_member_custom_field"]);
    if ($field->isValid()) {
        $headers["mm_custom_field"] = array('content' => $field->getDisplayName());
    } else {
        $useCustomField = false;
    }
}
if ($useCustomField2) {
    if ($_REQUEST["mm_member_custom_field2"] != $_REQUEST["mm_member_custom_field"]) {
        $field = new MM_CustomField($_REQUEST["mm_member_custom_field2"]);
        if ($field->isValid()) {
            $headers["mm_custom_field2"] = array('content' => $field->getDisplayName());
        } else {
            $useCustomField2 = false;
        }
    } else {
        $useCustomField2 = false;
    }
}
switch ($searchByDate) {
    case "user_registered":
        $headers["user_registered"] = array('content' => '<a onclick="mmjs.sort(\'user_registered\');" href="#">Registered</a>');
        break;
    case "status_updated":
        $headers["status_updated"] = array('content' => '<a onclick="mmjs.sort(\'status_updated\');" href="#">Status Changed</a>');
        break;
}