public static function generateFormSelectListForFormCreator($metadata = TRUE) { if ($metadata === TRUE) { if (($forms = forms::getMetadataForms()) === FALSE) { errorHandle::errorMsg("Error getting Metadata Forms"); return FALSE; } } else { if ($metadata === FALSE) { if (($forms = forms::getObjectForms()) === FALSE) { errorHandle::errorMsg("Error getting Object Forms"); return FALSE; } } } $formList = '<ul class="pickList">'; foreach ($forms as $form) { if (!mfcsPerms::isViewer($form['ID'])) { continue; } $formList .= sprintf('<li><a href="index.php?id=%s" class="btn">%s</a></li>', htmlSanitize($form['ID']), forms::title($form['ID'])); } $formList .= "<ul>"; return $formList; }
$tmp = NULL; foreach (array("top", "middle", "bottom") as $h) { foreach (array("left", "center", "right") as $w) { $tmp .= '<option value="' . $h . '|' . $w . '">' . ucfirst($h) . ' ' . ucfirst($w) . '</option>'; } } localVars::add("imageLocations", $tmp); unset($tmp); $tmp = '<option value="">None</option>'; foreach (validate::validationMethods() as $val => $text) { $tmp .= '<option value="' . $val . '">' . $text . '</option>'; } localVars::add("validationTypes", $tmp); unset($tmp); // Get list of forms for choices dropdown if (($metadataForms = forms::getMetadataForms()) === FALSE) { throw new Exception("Errer retreiving metadata forms"); } $tmp = array(); if (is_array($metadataForms)) { foreach ($metadataForms as $form) { $tmp[] = sprintf('<option value="%s">%s</option>', $form['ID'], $form['title']); } } localVars::add("formsOptions", implode(",", $tmp)); unset($tmp); // Get list of watermarks for dropdown $sql = sprintf("SELECT `ID`, `name` FROM `watermarks`"); $sqlResult = $engine->openDB->query($sql); if (!$sqlResult['result']) { throw new Exception("Error retreiving watermarks");