if ($changed && $execute) { $doTable->update(); } } } return $aChanged; } /*-------------------------------------------------------*/ /* HTML framework */ /*-------------------------------------------------------*/ echo "<br />"; echo $strEncodingExplaination; echo "<br /><br />"; phpAds_ShowBreak(); echo "<form action='maintenance-encoding.php' method='POST'>"; $oOptions = new Plugins_InvocationTagsOptions(); $aEncodings = $oOptions->_getAvailableCharsets(); $selectedFrom = !empty($_POST['encFrom']) ? $_POST['encFrom'] : 'UTF-8'; $selectedTo = !empty($_POST['encTo']) ? $_POST['encTo'] : 'UTF-8'; echo $strEncodingConvertFrom . " <select name='encFrom'>\n"; foreach ($aEncodings as $encCode => $encName) { $selected = $encCode == $selectedFrom ? " selected='selected'" : ''; echo " <option value='{$encCode}' {$selected}>{$encName}</option>\n"; } echo "</select> "; //echo $strEncodingConvertTo . " <select name='encTo'>\n"; //foreach ($aEncodings as $encCode => $encName) { // $selected = ($encCode == $selectedTo) ? " selected='selected'" : ''; // echo " <option value='{$encCode}' {$selected}>{$encName}</option>\n"; //} //echo "</select> ";
/** * Generate all the options for plugin settings and return as HTML * * @param object $maxInvocation MAX_Admin_Invocation object * * @return string */ function generateOptions(&$maxInvocation) { $this->setInvocation($maxInvocation); // Here I would like to set commonOptions on the invocationTag option prior to calling getOptionList // This means that within the invocationTag option I can remove common options where necessary $this->defaultOptions = $maxInvocation->getDefaultOptionsList(); $show = $this->getOptionsList($maxInvocation); $show += $this->defaultOptions; $invocationOptions = new Plugins_InvocationTagsOptions(); $invocationOptions->setInvocation($maxInvocation); $htmlOptions = ''; foreach ($show as $optionToShow => $methodType) { if ($methodType == MAX_PLUGINS_INVOCATION_TAGS_STANDARD) { if (!method_exists($invocationOptions, $optionToShow)) { MAX::raiseError("Method '{$optionToShow}' doesn't exists"); } else { $htmlOptions .= $invocationOptions->{$optionToShow}(); } } else { if (!method_exists($this, $optionToShow)) { MAX::raiseError("Method '{$optionToShow}' doesn't exists"); } else { $htmlOptions .= $this->{$optionToShow}(); } } } return $htmlOptions; }