public function setupDefinitions() { define("MM_TEMPLATE_BASE", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "templates"); define("MM_TEMPLATE_META", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . "metabox"); define("MM_TEMPLATE_USER", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . "user"); define("MM_TEMPLATE_ADMIN", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . "admin"); define("MM_TEMPLATE_SMARTTAGS", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . "smarttags"); define("MM_TEMPLATE_REPORTING", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . "reporting"); define("MM_MODULES", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "modules"); define("MM_DATA_DIR", MM_PLUGIN_ABSPATH . DIRECTORY_SEPARATOR . "data"); define("MM_IMAGES_PATH", MM_PLUGIN_ABSPATH . "" . DIRECTORY_SEPARATOR . "resources" . DIRECTORY_SEPARATOR . "images"); define("MM_PLUGIN_URL", plugins_url() . "/" . MM_PLUGIN_NAME); define("MM_MODULES_URL", MM_PLUGIN_URL . "/modules"); define("MM_API_BASE_URL", MM_PLUGIN_URL . "/api"); define("MM_API_URL", MM_PLUGIN_URL . "/api/request.php"); define("MM_PROCESS_ORDER_URL", MM_PLUGIN_URL . "/api/processOrder.php"); define("MM_TEMPLATES_URL", MM_PLUGIN_URL . "/templates/"); if (isset($_GET["export_file"]) && $_GET["export_file"] == MM_GET_KEY) { require_once MM_MODULES . "/export_file.php"; } // register SmartTags if we're loading a non-WordPress Admin page if (!is_admin() && class_exists("MM_SmartTagUtil")) { $smartTagUtil = new MM_SmartTagUtil(); $smartTagUtil->registerSmartTags(); } if (isset($_POST["exportdata"])) { $data = MM_Session::value(MM_Session::$KEY_CSV); if ($data !== false) { header("Content-type: text/csv"); header("Content-Disposition: filename=mm_export_" . Date("Y-m-d") . ".csv"); header("Pragma: no-cache"); header("Expires: 0"); echo $data; MM_Session::clear(MM_Session::$KEY_CSV); exit; } } // update cookies if (class_exists("MM_Cookies")) { MM_Cookies::setCookies(); } }
*/ ?> <style> #mm-dialog-container { height:100%; width:100%; border-collapse:collapse; } .mm-dialog-button-bar { width:100%; height:40px; text-align:right; } </style> <table id="mm-dialog-container"> <tr><td valign="top"> <div> <?php $product = new MM_Product($p->productId); if ($product->isValid()) { $context = new MM_Context(); $context->setProduct($product); echo MM_SmartTagUtil::processContent($product->getPurchaseConfirmationMessage(), $context); } else { echo "Invalid product ID '{$p->productId}'"; } ?> </div> </td></tr> <tr><td valign="bottom" class="mm-dialog-button-bar"> <a href="javascript:pymtutils_js.placeOrderCardOnFile(<?php echo $p->userId; ?> , <?php echo $p->productId; ?> , 'user', '<?php
/** * This function executes a [MM_..._Decision] SmartTag * @param String $smartTagName the new of the SmartTag to execute * @param Array $attributes an associative array of name/value pairs to pass to the SmartTag * @return Boolean returns the result of executing the SmartTag with the attributes passed */ function executeDecisionSmartTag($smartTagName, $attributes) { if (is_array($attributes)) { $smartTag = "[{$smartTagName}"; foreach ($attributes as $name => $value) { $smartTag .= " {$name}='{$value}'"; } $smartTag .= "]success[/{$smartTagName}]"; $context = new MM_Context(); $result = MM_SmartTagUtil::processContent($smartTag, $context); return $result == "success" ? true : false; } else { return false; } }