Пример #1
0
/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_CustomFieldView();
$dataGrid = new MM_DataGrid($_REQUEST, "id", "desc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "custom field";
$rows = array();
foreach ($data as $key => $item) {
    $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));
}
Пример #2
0
	<?php 
    }
    ?>
	</div>
<?php 
}
$doRenderForm = true;
$initialCreation = true;
$customField = new MM_CustomField($p->id);
// create custom field if it doesn't exist
if (!$customField->isValid()) {
    $customField = new MM_CustomField();
    $customField->setDisplayName("Untitled");
    $result = $customField->commitData();
    if (MM_Response::isSuccess($result)) {
        $customField = new MM_CustomField($customField->getId());
    } else {
        $doRenderForm = false;
    }
} else {
    $initialCreation = false;
}
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">
Пример #3
0
        $csvRow[] = $user->getStatusName();
        $csvRow[] = $user->getBillingAddress();
        $csvRow[] = $user->getBillingCity();
        $csvRow[] = $user->getBillingState();
        $csvRow[] = $user->getBillingZipCode();
        $csvRow[] = $user->getBillingCountryName();
        $csvRow[] = $user->getShippingAddress();
        $csvRow[] = $user->getShippingCity();
        $csvRow[] = $user->getShippingState();
        $csvRow[] = $user->getShippingZipCode();
        $csvRow[] = $user->getShippingCountryName();
        $fields = MM_CustomField::getCustomFieldsList();
        foreach ($fields as $id => $val) {
            $customField = new MM_CustomField($id);
            if ($customField->isValid()) {
                $csvRow[] = stripslashes($user->getCustomDataByFieldId($customField->getId())->getValue());
            }
        }
        $csvRows[] = $csvRow;
    }
}
// store CSV in session
if ($doGenerateCsv) {
    $csv = "";
    foreach ($csvRows as $row) {
        $csvRow = "";
        foreach ($row as $elem) {
            $csvRow .= "\"" . preg_replace("/[\"]+/", "", $elem) . "\",";
        }
        $csv .= preg_replace("/(\\,)\$/", "", $csvRow) . "\n";
    }