'; echo ("
\n"); echo ''; include 'main_footer.php'; } /** * Runs the dry run and change actions. * * @param htmlTable $container container */ function runActions(&$container) { // LDAP suffix if ($_POST['suffix'] == '-') { $suffix = trim($_POST['otherSuffix']); } else { $suffix = $_POST['suffix']; } if (empty($suffix)) { $error = new htmlStatusMessage('ERROR', _('LDAP Suffix is invalid!')); $error->colspan = 5; $container->addElement($error); return; } // LDAP filter $filter = trim($_POST['filter']); // operations $operations = array(); for ($i = 0; $i < sizeof($_POST['opcount']); $i++) { if (!empty($_POST['attr_' . $i])) { $operations[] = array($_POST['op_' . $i], $_POST['attr_' . $i], $_POST['val_' . $i]); } } if (sizeof($operations) == 0) { $error = new htmlStatusMessage('ERROR', _('Please specify at least one operation.')); $error->colspan = 5; $container->addElement($error); return; } $_SESSION['multiEdit_suffix'] = $suffix; $_SESSION['multiEdit_filter'] = $filter; $_SESSION['multiEdit_operations'] = $operations; $_SESSION['multiEdit_status'] = null; // disable all input elements $jsContent = ' jQuery(\'input\').attr(\'disabled\', true); jQuery(\'select\').attr(\'disabled\', true); jQuery(\'button\').attr(\'disabled\', true); '; $container->addElement(new htmlJavaScript($jsContent), true); // progress area $container->addElement(new htmlSubTitle(_('Progress')), true); $progressDiv = new htmlDiv('progressArea', ''); $progressDiv->colspan = 5; $container->addElement($progressDiv, true); // JS block for AJAX status update $ajaxBlock = ' jQuery.get(\'multiEdit.php?ajaxStatus\', null, function(data) {handleReply(data);}, \'json\'); function handleReply(data) { jQuery(\'#progressArea\').html(data.content); if (data.status != "finished") { jQuery.get(\'multiEdit.php?ajaxStatus\', null, function(data) {handleReply(data);}, \'json\'); } else { jQuery(\'input\').removeAttr(\'disabled\'); jQuery(\'select\').removeAttr(\'disabled\'); jQuery(\'button\').removeAttr(\'disabled\'); } } '; $container->addElement(new htmlJavaScript($ajaxBlock), true); } /** * Performs the modify operations. */ function runAjaxActions() { $jsonReturn = array( 'status' => 'finished', 'content' => 'content' ); echo json_encode($jsonReturn); }