static function Button($icon = 'fire', $text = '', $style = '', $link = '', $js = '') { $style = ' btn-' . $style; if (empty($link)) { $link = '#'; } if (!empty($js)) { $js = 'onclick="javascript: submitbutton(\'' . $js . '\')"'; } return '<a data-original-title="' . JText::_($text) . '" rel="tooltip" href="' . $link . '"' . $js . ' class="btn' . $style . '">' . aecHTML::Icon($icon) . '</a>'; }
public function index($cmd) { $path = JPATH_SITE . '/components/com_acctexp/toolbox'; if (empty($cmd)) { $list = array(); $files = xJUtility::getFileArray($path, 'php', false, true); asort($files); foreach ($files as $n => $name) { $file = $path . '/' . $name; include_once $file; $class = str_replace('.php', '', $name); $tool = new $class(); if (!method_exists($tool, 'Info')) { continue; } $info = $tool->Info(); $info['link'] = AECToolbox::deadsureURL('administrator/index.php?option=com_acctexp&task=index&entity=toolbox&cmd=' . $class); $list[] = $info; } HTML_AcctExp::toolBox('', $list); } else { $file = $path . '/' . $cmd . '.php'; include_once $file; $tool = new $cmd(); $info = $tool->Info(); $return = ''; if (!method_exists($tool, 'Action')) { $return .= '<section class="paper">' . '<p>Tool doesn\'t have an action to carry out!</p>' . '</section>'; } else { $response = '</section><section class="paper"><h4>' . JText::_('Response') . '</h4>' . $tool->Action() . '</section>'; if (method_exists($tool, 'Settings')) { $tb_settings = $tool->Settings(); if (!empty($tb_settings)) { $lists = array(); if (isset($tb_settings['lists'])) { $lists = $tb_settings['lists']; unset($tb_settings['lists']); } // Get preset values from POST foreach ($tb_settings as $n => $v) { if (isset($_POST[$n])) { $tb_settings[$n][3] = $_POST[$n]; } } $settings = new aecSettings('TOOLBOX', 'E'); $settings->fullSettingsArray($tb_settings, array(), $lists); // Call HTML Class $aecHTML = new aecHTML($settings->settings, $settings->lists); foreach ($tb_settings as $n => $v) { $return .= $aecHTML->createSettingsParticle($n); } $return .= '<input type="submit" class="btn btn-primary pull-right"/><br/><br/>'; } } $return .= $response; } HTML_AcctExp::toolBox($cmd, $return, $info['name']); } }
<?php /** * @version $Id: backtocart.php * @package AEC - Account Control Expiration - Membership Manager * @subpackage Main Frontend * @copyright 2012 Copyright (C) David Deutsch * @author David Deutsch <*****@*****.**> & Team AEC - http://www.valanx.org * @license GNU/GPL v.3 http://www.gnu.org/licenses/gpl.html or, at your option, any later version */ // Dont allow direct linking defined('_JEXEC') or die('Direct Access to this location is not allowed.'); ?> <form id="form-backtocart" action="<?php echo AECToolbox::deadsureURL('index.php?option=' . $option . '&task=cart', $tmpl->cfg['ssl_signup']); ?> " method="post"> <div class="backtocart-button"> You can always go back to: <button type="submit" class="btn btn-default"><?php echo aecHTML::Icon('shopping-cart') . JText::_('AEC_BTN_YOUR_CART'); ?> </button> </div> <?php echo JHTML::_('form.token'); ?> </form>
?> </td> </tr> <?php } else { ?> <tr> <td></td> <td></td> <td class="center-cell"><button type="submit" class="btn btn-info pull-right"><?php echo aecHTML::Icon('refresh', ' btn-icononly'); ?> </button></td> <td></td> <td class="center-cell"><div id="clear-button"><?php echo $tmpl->lnk(array('task' => 'clearCart'), aecHTML::Icon('trash', ' narrow'), 'btn btn-danger btn-icononly'); ?> </div></td> </tr> <tr> <td><strong><?php echo JText::_('CART_ROW_TOTAL'); ?> </strong></td> <td></td> <td></td> <td><strong><?php echo $bitem['cost']; ?> </strong></td> <td></td>
$params = array(); foreach ($form as $k => $v) { if (isset($_POST[$k])) { $params[str_replace($pref, '', $k)] = $_POST[$k]; } } $mi->profile_form_save($metaUser, $params); // Reload the user $metaUser = new metaUser($metaUser->userid); $form = $mi->profile_form($metaUser); } if (!empty($form)) { $hasforms = true; $settings = new aecSettings('userForm', 'mi'); $settings->fullSettingsArray($form, array(), array()); $aecHTML = new aecHTML($settings->settings, $settings->lists); $html = ''; foreach ($form as $k => $f) { $html .= $aecHTML->createSettingsParticle($k); } $mi_info .= '<div class="' . $mi->class_name . ' mi_' . $mi->id . ' mi-form">' . $html . '</div>'; } $addtabs = $mi->registerProfileTabs(); if (empty($addtabs)) { continue; } foreach ($addtabs as $atk => $atv) { $action = $mi->class_name . '_' . $atk; if (isset($subfields[$action])) { continue; }
/** * @param aecHTML $aecHTML */ static function echoSettings($aecHTML) { $stdvars = array(array(array('mingid_enabled', 'mingid'), array('fixgid_enabled', 'fixgid'), array('maxgid_enabled', 'maxgid')), array(array('previous*_req_enabled', 'previous*_req'), array('previous*_req_enabled_excluded', 'previous*_req_excluded'), array('current*_req_enabled', 'current*_req'), array('current*_req_enabled_excluded', 'current*_req_excluded'), array('overall*_req_enabled', 'overall*_req'), array('overall*_req_enabled_excluded', 'overall*_req_excluded')), array(array('used_*_min_enabled', 'used_*_min_amount', 'used_*_min'), array('used_*_max_enabled', 'used_*_max_amount', 'used_*_max')), array(array('custom_restrictions_enabled', 'custom_restrictions'))); $types = array('plan', 'group'); echo '<div class="row">'; foreach ($types as $type) { foreach ($stdvars as $block) { // non-* blocks only once if (strpos($block[0][0], '*') === false && $type != 'plan') { continue; } echo '<div class="col-sm-4"><section class="paper">'; $firstitem = str_replace('*', $type, $block[0][0]); echo '<h4>' . JText::_(strtoupper('aec_restrictions_' . substr($firstitem, 0, strpos($firstitem, '_', strpos($firstitem, '_') + 3)) . '_header')) . '</h4>'; foreach ($block as $sblock) { foreach ($sblock as $vname) { echo $aecHTML->createSettingsParticle(str_replace('*', $type, $vname)); } } echo '</section></div>'; } } echo '</div>'; }
public function getMIforms($metaUser, $errors = array(), $values = array()) { $params = $this->getMIformParams($metaUser, $errors); if (empty($params)) { return false; } if (isset($params['lists'])) { $lists = $params['lists']; unset($params['lists']); } else { $lists = array(); } if (isset($params['validation'])) { unset($params['validation']); } if (empty($params)) { return null; } $settings = new aecSettings('mi', 'frontend_forms'); $settings->fullSettingsArray($params, $values, $lists, array(), false); $aecHTML = new aecHTML($settings->settings, $settings->lists); return $aecHTML->returnFull(false, true); }
<input type="hidden" name="processor" value="<?php echo $InvoiceFactory->processor; ?> " /> <?php if (isset($InvoiceFactory->recurring)) { ?> <input type="hidden" name="recurring" value="<?php echo $InvoiceFactory->recurring; ?> " /> <?php } ?> <?php if ($passthrough != false) { ?> <input type="hidden" name="aec_passthrough" value="<?php echo $passthrough; ?> " /> <?php } ?> <button type="submit" class="button btn btn-success" id="confirmation"><?php echo aecHTML::Icon('ok'); echo JText::_('BUTTON_CONFIRM'); ?> </button> </div>
public function addValidation() { $this->enqueueJQueryExtension('jquery/jquery.validate'); $this->enqueueJQueryExtension('jquery/jquery.validate.additional-methods'); $msgs = array('required' => 0, 'remote' => 0, 'email' => 0, 'url' => 0, 'date' => 0, 'dateISO' => 0, 'number' => 0, 'digits' => 0, 'creditcard' => 0, 'equalTo' => 0, 'maxlength' => 1, 'minlength' => 1, 'rangelength' => 2, 'range' => 2, 'max' => 1, 'min' => 1, 'maxwords' => 1, 'minwords' => 1, 'rangewords' => 2, 'letterswithbasicpunc' => 0, 'alphanumeric' => 0, 'alphanumericwithbasicpunc' => 0, 'lettersonly' => 0, 'nowhitespace' => 0, 'ziprange' => 0, 'zipcodeus' => 0, 'integer' => 0, 'vinus' => 0, 'dateita' => 0, 'datenl' => 0, 'time' => 0, 'time12h' => 0, 'phoneus' => 0, 'phoneuk' => 0, 'mobileuk' => 0, 'phonesuk' => 0, 'postcodeuk' => 0, 'strippedminlength' => 1, 'email2' => 0, 'url2' => 0, 'creditcardtypes' => 0, 'ipv4' => 0, 'ipv6' => 0, 'pattern' => 0, 'require_from_group' => 1, 'skip_or_fill_minimum' => 1, 'accept' => 0, 'extension' => 0); $messages = array(); foreach ($msgs as $k => $i) { if ($i) { $messages[] = $k . ': ' . 'jQuery.validator.format("' . JText::_(strtoupper('aec_validate_' . $k)) . '")'; } else { $messages[] = $k . ': ' . '"' . JText::_(strtoupper('aec_validate_' . $k)) . '"'; } } $js = "jQuery(document).ready(function(){\n\n\t\t\tjQuery.extend(jQuery.validator.messages, {" . implode(",\n", $messages) . "} );\n\n\t\t\tjQuery('#aec form:last').validate(\n\t\t\t{\n\t\t\trules: " . json_encode($this->validation['rules']) . ",\n\t\t\thighlight: function(label) {\n\t\t\t\tjQuery(label).closest('.well').addClass('well-highlight');\n\t\t\t\tjQuery(label).closest('.form-group').addClass('error');\n\t\t\t\tjQuery(label).closest('.label-important').prepend('" . addslashes(aecHTML::Icon('ban-circle')) . "');\n\t\t\t\tjQuery('#aec form button#confirmation').attr('disabled','disabled');\n\t\t\t},\n\t\t\tunhighlight: function(label) {\n\t\t\t\tjQuery(label).closest('.well').removeClass('well-highlight');\n\t\t\t\tjQuery(label).closest('.form-group').removeClass('error');\n\t\t\t\tif ( jQuery(\"#aec form .label-important\").length > 0) {\n\t\t\t\t\tjQuery('#aec form button').attr('disabled','disabled');\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('#aec form button').attr(\"disabled\", false);\n\t\t\t\t}\n\t\t\t},\n\t\t\tsuccess: function(label) {\n\t\t\t\tlabel.remove();\n\n\t\t\t\tjQuery('#aec form button').attr(\"disabled\", false);\n\t\t\t},\n\t\t\terrorClass: 'label label-important',\n\t\t\tsubmitHandler: function(form) {\n\t\t\t\tif ( jQuery('#aec form').valid() ) {\n\t\t\t\t\tform.submit();\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('#aec form button').attr('disabled','disabled');\n\t\t\t\t}\n\t\t\t}\n\t\t\t});\n\t\t});"; $this->enqueueJQueryCode($js); }
public function checkoutAction($request, $InvoiceFactory = null) { $var = $this->createGatewayLink($request); if (isset($var['_aec_html_head'])) { $document = JFactory::getDocument(); if (is_array($var['_aec_html_head'])) { foreach ($var['_aec_html_head'] as $content) { $document->addCustomTag($content); } } else { $document->addCustomTag($var['_aec_html_head']); } unset($var['_aec_html_head']); } if (!empty($this->settings['customparams'])) { $var = $this->customParams($this->settings['customparams'], $var, $request); } if (isset($var['_aec_checkout_onclick'])) { $onclick = ' onclick="' . $var['_aec_checkout_onclick'] . '"'; unset($var['_aec_checkout_onclick']); } else { $onclick = ''; } $return = '<a href="' . $var['post_url']; unset($var['post_url']); if (substr($return, -1, 1) !== '?') { $return .= '?'; } $vars = array(); if (!empty($var)) { foreach ($var as $key => $value) { $vars[] .= urlencode($key) . '=' . urlencode($value); } $return .= implode('&', $vars); } $return .= '"' . $onclick . ' class="button aec-btn btn btn-primary" >' . aecHTML::Icon('shopping-cart') . JText::_('BUTTON_CHECKOUT') . '</a>' . "\n"; return $return; }
public function orderDownIcon($i, $n, $condition = true, $task = 'orderdown', $alt = 'JLIB_HTML_...', $enabled = true, $checkbox = 'cb') { $order = '<a class="btn" onclick="return listItemTask(\'cb' . $i . '\',\'' . $task . '\')" href="#reorder"' . ($enabled ? '' : ' disabled="disabled"') . '>'; $order .= aecHTML::Icon('chevron-down'); $order .= '</a>'; return $order; }
?> <?php if (empty($InvoiceFactory->userid)) { ?> <p>Save Registration to Continue Shopping:</p> <?php } else { if (!empty($tmpl->cfg['customlink_continueshopping'])) { $continueurl = $tmpl->cfg['customlink_continueshopping']; } else { $continueurl = $tmpl->url(array('task' => 'subscribe')); } ?> <div id="continue-button"> <form id="form-continue" action="<?php echo $continueurl; ?> " method="post"> <button type="submit" class="btn btn-default"><?php echo aecHTML::Icon('arrow-left') . JText::_('AEC_BTN_CONTINUE_SHOPPING'); ?> </button> </form> </div> <br /> <?php } ?> </div>