private function _ConfModal($mode, $icon, $type, $action, $auth = false, $conf = false, $prompt = '', $cust = false) { $mod_id = substr(crc32(microtime()), 1, 6); if ($prompt == '') { $prompt = '<p>Are you sure you want to ' . $mode . ' the following ' . $type . ':</p>'; } $mod_content = $prompt . PHP_EOL; $mod_content .= '<ul id="' . $mode . '_' . $type . '"></ul>' . PHP_EOL; $mod_form = new Form($mode . '_f', $action, 'post', 'application/x-www-form-urlencoded', $mode . '_' . $type . '(); return false;'); $mod_form->setColumns(4, 8); $mod_form->addHiddenField($type, '', $type . '_to_' . $mode); if ($auth) { $mod_form->addPasswordField('Your Password', 'pwd', '', array('t' => 'Your password to confirm the operation', 'p' => 'Your Password'), array('t' => 'password', 'r' => true)); } if ($conf) { $mod_form->addButtonGroup('Are you sure?', 'conf', array(array('i' => 'confY' . $mod_id, 's' => B_T_SUCCESS, 'v' => 1, 'l' => 'Yes', 'c' => false), array('i' => 'confN' . $mod_id, 's' => B_T_FAIL, 'v' => 0, 'l' => 'No', 'c' => true)), array('t' => 'Are you sure you wish to perform this action?')); } $mod_form->build(); $mod_content .= $mod_form->getForm(); $mod = new Modal(); $mod->setID($mode); $mod->setTitle(ucfirst($mode) . ' ' . ucfirst($type) . '?'); $mod->setBody($mod_content); $mod->setLeft('default', 'Cancel', 'remove-sign', 'button', '$(\'#' . $mode . '\').modal(\'hide\')'); $mod->setRight('danger', 'OK', $icon, 'button', $mode . '_' . $type . '(this)'); $mod->create(); $this->comps[] = $mod->getModal(); $this->_addConfModalScript($mode, $type, $cust); }
print $tabindex; ?> " class="btn btn-large btn-danger btn-block" >Delete Compeition <span class="<?php print B_ICON . ' ' . B_ICON; ?> -trash"></span></button> </div> </div> </div> </div> <?php $deleteConf = new Modal(); $deleteConf->setID('delConf'); $deleteConf->setBody('Are you sure you wish to delete this competition?<br />All data associated with this competition will be lost.'); $deleteConf->setTitle('Delete Competition?'); $deleteConf->setLeft('default', 'Cancel', 'remove-sign'); $deleteConf->setRight('danger', 'Delete', 'trash', 'submit'); print $deleteConf->getModal(); ?> </form> </div> </div> <script type="text/javascript"> $("#recaptcha_response_field").attr("tabindex","<?php print $recaptchaTab; ?> "); function openModal(){ if(Spry.Widget.Form.validate(document.getElementById("remove"))){ $("#delConf").modal('show');