function dev_email_form($href = '', $to = '', $additional_fields = '') { $href = dev_href($href); $additional_fields = dev_value_to_array($additional_fields); $output = ''; $output .= dev_draw_form() . dev_draw_form_field($to == '' ? 'text' : 'hidden', 'rcpt', 'To', '') . dev_draw_form_field('text', 'subject', 'Subject', ''); foreach ($additional_fields as $a => $b) { $output .= dev_draw_form_field('text', $a, $b, ''); } $output .= dev_draw_form_field('textarea', 'message', 'Message', '') . dev_draw_form_field('submit', 'submit', 'Send', 'Send') . dev_draw_form_field('reset', 'reset', 'Reset', 'Reset') . dev_close_form(); return $output; }
function dev_content_box($content_r, $cols = 0, $href = '', $query_r = '', $highlight = '', $header = '', $link_style = '1', $show_image = false, $img_dir = 'images/', $file_dir = '', $icon = '', $trunc = '', $fields = '') { $hori = 0; $output = "<table class=\"dev_table\"" . ($header === false ? '' : " id=\"anyid\"") . ">\n"; $bg = false; $href = dev_href($href); $count = 0; $new_row = 1; foreach ($content_r as $row) { $fields = $fields != '' && $fields >= 0 && $fields < count($row) ? $fields : count($row); if ($count == 0) { if ($header !== false) { $header = is_array($header) && count($header) == count($row) ? $header : $row; if (dev_is_assoc($header)) { $header = array_keys($header); } $output .= '<tr>'; $i = 0; foreach ($header as $a) { if ($i == 0 && $link_style != 1 && $link_style !== 0) { $output .= '<th>'; $output .= ''; $output .= "</th>"; } if ($i > 0) { $output .= '<th>'; $output .= $a; $output .= "</th>"; } $i++; if ($i > $fields) { break; } } $output .= "</tr>\n"; } } //manage columns //$new_row = ($hori < $cols) ? 0 : 1; if ($hori == 0) { $output .= '<tr'; if ($highlight != '') { $output .= $bg ? ' bgcolor="' . $highlight . '"' : ''; $bg = dev_flip_bool($bg); } $output .= '>'; } $i = 0; foreach ($row as $a => $b) { if ($i > 0 || $header === false && $link_style != 1) { if (!($icon != '' && $fields == 2 && $i == 2)) { $output .= '<td>'; } if (($i == 1 || $icon != '' && ($i = 2)) && $link_style == 1) { $output .= '<a class="contentBox" href="' . $href . '?' . $varname . '=' . $value . (dev_is_assoc($query_r) ? '&' . http_build_query($query_r) : '') . '">'; } if (!$show_image || $trunc != '') { $data = dev_format_data($b, '', $trunc); } else { $data = $b; } if ($i != 1) { $data = dev_link_file($data, $file_dir); } if ($icon != '' && $i == 1) { $data = dev_print_image($data == '' ? $icon : $data, $img_dir, '', '50', '', '', '', '', '', $icon) . ($fields == 1 ? "<br />" . $data : ''); } elseif ($show_image) { $data = dev_print_image($data, $img_dir, $data, '100', '', true, '', false); } $output .= $data; if ($i == 1 && $link_style == 1) { $output .= "</a>"; } if (!($icon != '' && $fields == 2 && $i == 1)) { $output .= "</td>"; } } elseif ($i == 0) { if ($link_style == 2) { $output .= '<td>'; $output .= dev_draw_form($href) . dev_draw_form_field('hidden', $a, '', $b) . dev_draw_form_field('submit', 'submit', '', 'Go'); if (dev_is_assoc($query_r)) { foreach ($query_r as $c => $d) { $output .= dev_draw_form_field('hidden', $c, '', $d); } } $output .= dev_close_form(); $output .= "</td>"; } elseif ($link_style == 3) { $output .= '<td>'; //$output .= dev_draw_form($href); $output .= dev_draw_form_field('checkbox', $a . '[]', '', $b); if (dev_is_assoc($query_r)) { foreach ($query_r as $c => $d) { $output .= dev_draw_form_field('hidden', $c, '', $d); } } //$output .= dev_close_form(); $output .= "</td>"; } else { $varname = $a; $value = $b; } } $i++; if ($i > $fields) { break; } } $output .= "\n"; if ($hori < $cols) { $hori++; } else { $output .= "</tr>\n"; $hori = 0; } $count++; } if ($hori != 0) { $output .= "</tr>\n"; } $output .= "</table>\n"; return $output; }
function drawControl() { //Author: Devon .M. Scott //Database and file management vars. //$action = (isset($_POST['action']) && $_POST['action'] != '') ? $_POST['action'] : $_GET['action']; $view = isset($_POST['view']) && $_POST['view'] != '' ? $_POST['view'] : (isset($_GET['view']) && $_GET['view'] != '' ? $_GET['view'] : (isset($_COOKIE['view']) && $_COOKIE['view'] != '' ? $_COOKIE['view'] : 'select')); $file = isset($_POST['file']) && $_POST['file'] != '' ? $_POST['file'] : $_GET['file']; $dir = isset($_POST['dir']) && $_POST['dir'] != '' ? $_POST['dir'] : $_GET['dir']; $action = isset($_POST['action']) && $_POST['action'] != '' ? $_POST['action'] : $_GET['action']; $mode = isset($_POST['mode']) && $_POST['mode'] != '' ? $_POST['mode'] : $_GET['mode']; $options_on = $this->getOptionsOn(); $href = dev_href($this->getHref($href)); //$href = 'index.php'; $output = ''; $status = ''; if (count($this->getOptions()) <= 0) { $option_list = new DevObject(DEV_OPTIONS); $option_list->clearMembers(); $option_list->setCondition('option_enable', '=', '1'); $option_list->setCondition('option_group', '=', $this->getTables()); $options_set = array(); foreach ($option_list->createMemberArray() as $a) { $options_set[] = $a['option_name']; } } else { $options_set = $this->getOptions(); } if (!in_array($action, $options_set) && $options_on === true) { if ($action != '') { $output .= '<b>You do not have permission to take this action.</b><br /><br />'; } $action = 'list'; } $option = array(); $image_dir = $this->getWSPath() . $this->getImageDir(); $image_upload_dir = $this->getFSPath() . $this->getImageDir(); $file_dir = $this->getWSPath() . $this->getFileDir(); $file_upload_dir = $this->getFSPath() . $this->getFileDir(); $query = array(); //$filedir = 'filedir/'; if ($dir != $file_upload_dir && $dir != '') { $query['d'] = $dir; $file_upload_dir = $dir; } $object = $this->getControlObject(0); $options = array(); if ($this->getLogo() != '') { $output .= dev_print_image($this->getLogo()); } if ($this->getTitle() != '') { $output .= "<h1>" . $this->getTitle() . "</h1>"; } //$object->toggleActiveFieldsOn(true); $object->clearMembers(); $object->setActiveFields($this->getFieldHeaders()); $entry_id_var = $object->getPrimaryKey(); ${$entry_id_var} = isset($_POST[$entry_id_var]) && $_POST[$entry_id_var] != '' ? $_POST[$entry_id_var] : $_GET[$entry_id_var]; //$files = new DevObject('files'); //$files->clearMembers(); if ($action == 'edit' || $action == 'delete' || $action == 'manageimages' || $action == 'changeimages' || $action == 'upload' || $action == 'view' || $action == 'default') { //$object->loadFreshMembers(); $object->clearMembers(); $object->loadGetVars(); $object->loadPostVars(); if ($action == 'default' || $action == 'view') { $object->loadArrayVars($this->getFieldDefaults()); } $object->loadMembers(); foreach ($object->getMemberArray() as $a => $b) { global ${$a}; ${$a} = $b; } //echo $object->getQuery(); } elseif ($action == 'deletefile') { $files->loadFreshMembers(); foreach ($files->getMemberArray() as $a => $b) { ${$a} = $b; } } $delete_form = ' Really delete entry \'' . ${$entry_id_var} . '\' From the database? (Deletion is NOT undoable).<br />' . dev_draw_form_field('hidden', $entry_id_var, '', ${$entry_id_var}) . '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . ${$entry_id_var} . '">No, return to this entry</a><br /><br />' . '<input type="submit" value="Yes, Delete Forever" /><br />'; //$options[] = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . $$entry_id_var . '">No, return to this entry</a>'; /* $delete_file_form = ' Really delete file \'' . $files_document . '\'? (Deletion is NOT undoable).<br />' . dev_draw_form_field('hidden', $entry_id_var, '', $$entry_id_var) . dev_draw_form_field('hidden', 'files_id', '', $files_id) . '<a href="' . $href . '?action=managefiles&' . $entry_id_var . '=' . $$entry_id_var . '">No, return to this entry\'s files</a><br /><br />' . '<input type="submit" value="Yes, Delete Forever" /><br />'; */ $delete_file_form .= "Really delete file '{$file}'? (Deletion is <b>NOT</b> undoable).<br />\n" . '<a href="' . $href . '?dir=' . $dir . '&file=' . $file . '&action=removefile">Yes, delete forever.</a><br /><br />' . '<a href="' . $href . '?dir=' . $dir . '&action=listfiles">Back to List</a><br /><br />'; //$options[] = '<a href="' . $href . '?action=managefiles&' . $entry_id_var . '=' . $$entry_id_var . '">No, return to this entry\'s files</a>'; $static_fields_r = array(); foreach ($object->getFullFieldArray() as $a => $b) { $static_fields_r[$a] = 'static'; } //$view_form = $this->drawManageForm($object, 'View Details', $static_fields_r, 'Edit', 'Reset'); $view_form = dev_detail_box($object->getFullFieldArray()); $edit_form = $this->drawManageForm($object, 'Manage Entry', $this->getFieldTypes(), 'Submit', 'Clear', $action == 'edit' || $action == 'new' || $action == 'post' ? true : false); $mail_form = $this->drawManageForm($object, 'Send Message', $this->getFieldTypes(), 'Send', 'Clear'); //$options[] = '<a href="' . $href . '?action=new">Create New</a>'; //$options[] = '<a href="' . $href . '?action=list">Back to List</a>'; /* $upload_form = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . $_GET[$entry_id_var] . '">Return to this entry</a><br /><br />' . '<a href="' . $href . '?action=managefiles&' . $entry_id_var . '=' . $_GET[$entry_id_var] . '">Manage existing uploaded files</a><br /><br />' . 'Upload files to associate to your entry<br />' . dev_draw_form_field('hidden', $entry_id_var, '', $_GET[$entry_id_var]) . dev_draw_form_field('hidden', 'MAX_FILE_SIZE', '', '1024000000') . dev_draw_form_field('text', 'project_program_title', 'Programs Title', $project_programs_title) . dev_draw_form_field('file', 'program', 'Programs', $programs) . dev_draw_form_field('text', 'project_minutes_title', 'Minutes Title', $project_minutes_title) . dev_draw_form_field('file', 'minutes', 'Minutes', $minutes) . dev_draw_form_field('text', 'project_notices_title', 'Notices Title', $project_notices_title) . dev_draw_form_field('file', 'notices', 'Notices', $notices) . dev_draw_form_field('text', 'project_images_title', 'Images Title', $project_images_title) . dev_draw_form_field('file', 'images', 'Images', $images) . dev_draw_form_field('text', 'project_misc_title', 'Miscellaneous Title', $project_misc_title) . dev_draw_form_field('textarea', 'project_misc', 'Miscellaneous', $project_misc) . '<input type="submit" value="Upload" />'; */ $upload_form = dev_draw_form_field('hidden', 'dir', '', $dir) . dev_draw_form_field('file', 'file', 'File') . dev_draw_form_field('submit', 'uploadfiles', 'Upload', 'Upload'); $edit_file_form = '<a href="' . $href . '?dir=' . $dir . '&file=' . $file . '&action=edit&mode=richtext">Rich Text Mode</a><br /><br />'; //dev_draw_form_field('hidden', 'action', '', 'savefile') . dev_edit_file($dir . $file); $view_file_form = dev_draw_form_field('hidden', 'dir', '', $dir) . dev_draw_form_field('static', 'file', 'Filename', $file) . dev_draw_form_field('static', 'data', 'Data', dev_view_file($dir . $file)) . dev_draw_form_field('submit', 'editfile', 'Edit', 'Edit'); //$options[] = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . $_GET[$entry_id_var] . '">Return to this entry</a>'; //$options[] = '<a href="' . $href . '?action=managefiles&' . $entry_id_var . '=' . $_GET[$entry_id_var] . '">Manage existing uploaded files</a>'; $output .= dev_draw_form(); switch ($action) { case 'remove': if ($_POST[$entry_id_var] != '' && $_POST[$entry_id_var] > 0) { $object->clearMembers(); $object->loadPostVars(); $status .= $object->deleteObject() ? "Successfully Deleted Entry " : "Deletion Failed"; $object->clearMembers(); } default: case 'list': //$object->setSortOrder('entry_name', 'ASC'); $action = 'edit'; $field_names = array_values($this->getFieldHeaders()); if (is_array($field_names)) { $object->setSortOrder($field_names[1], 'ASC'); } $object->loadPostVars(); $object->setDistinction($entry_id_var); $options['new'] = '<a href="' . $href . '?action=new">' . $this->getIcon('new') . 'Create New</a>'; $options['search'] = '<a href="' . $href . '?action=search">' . $this->getIcon('search') . 'Search</a>'; $query_r = array('action' => 'view'); //$output .= dev_content_box($object->createMemberArray(), '', $href, $query_r, '#c0c0c0', '', '1', true, '../forum/'); //$output .= dev_list_results($object->createMemberArray(), 'begin', 'end', $href, true, 1, $query_r, '', $image_dir, $file_dir, $this->getFieldHeaders()); $output .= 'View: <a href="' . $href . '?view=icon">icons</a> | <a href="' . $href . '?view=search">list</a> | <a href="' . $href . '?view=select">selection</a><br />'; $output .= dev_display_box($object->createMemberArray(), $view, $href, $query_r, '#c0c0c0', $this->getFieldHeaders(), '1', true, $image_dir, $file_dir, '', 15); break; case 'advancedsearch': //if ($action == 'advancedsearch') { $options['search'] = '<a href="' . $href . '?action=search">' . $this->getIcon('search') . 'Basic Search</a>'; $options['new'] = '<a href="' . $href . '?action=new">' . $this->getIcon('new') . 'Create New</a>'; $options['list'] = '<a href="' . $href . '?action=list">' . $this->getIcon('list') . 'Back to List</a>'; //$output .= dev_draw_form() . $action = 'list'; $output .= dev_draw_form_field('hidden', 'view', '', 'search') . $object->drawForm($field_types) . dev_draw_form_field('submit', 'submit', 'Finding...', 'Find'); //dev_close_form(); //} break; case 'search': //if ($action == 'search') { $options['advancedsearch'] = '<a href="' . $href . '?action=advancedsearch">' . $this->getIcon('advancedsearch') . 'Advanced Search</a>'; $options['new'] = '<a href="' . $href . '?action=new">' . $this->getIcon('new') . 'Create New</a>'; $options['list'] = '<a href="' . $href . '?action=list">' . $this->getIcon('list') . 'Back to List</a>'; $field_names = array_values($this->getFieldHeaders()); //$object->setDistinction($entry_id_var); //$object->setSortOrder('entry_location', 'ASC'); $action = 'list'; $output .= '<table>' . dev_draw_form_field('hidden', 'view', '', 'search') . $object->formField($field_names[1]) . '</table>' . dev_draw_form_field('submit', 'submit', 'Finding...', 'Find'); //dev_close_form(); //} break; //OBJECT ACTION CASES //OBJECT ACTION CASES case 'save': $action = 'save'; $object->loadPostVars(); $success = dev_save_file($file, $view_form, $mode); $options['back'] = strpos($success, 'successful') === false ? ' <a class="dev_option" href="javascript:history.back(1)">' . $this->getIcon('back') . 'Go back</a>' : ''; break; case 'cookie': $action = 'cookie'; $object->loadPostVars(); foreach ($object->getMemberArray() as $a => $b) { $success .= dev_set_cookie($a, $b); } $options['back'] = !$success ? ' <a class="dev_option" href="javascript:history.back(1)">' . $this->getIcon('back') . 'Go back</a>' : ''; break; case 'session': $action = 'save'; $object->loadPostVars(); foreach ($object->getMemberArray() as $a => $b) { $success .= dev_set_session($a, $b); } $options['back'] = !$success ? ' <a class="dev_option" href="javascript:history.back(1)">' . $this->getIcon('back') . 'Go back</a>' : ''; break; case 'sendmail': $action = 'semdmail'; $sucess = dev_send_email($rcpt, $from, $subject, $message, $cc, $bcc, $html, $headers_r, $additional); $options['back'] = strpos($success, 'successful') === false ? ' <a class="dev_option" href="javascript:history.back(1)">' . $this->getIcon('back') . 'Go back</a>' : ''; case 'mail': $action = 'sendmail'; $output .= $mail_form; break; case 'post': $action = 'post'; $object->loadPostVars(); foreach ($_FILES as $a => $b) { if ($b['size'] > 0) { $b['name'] = str_replace(' ', '_', $b['name']); $object->{$a} = $b['name']; $status .= dev_upload_file($b, 1, $image_upload_dir); } } $success .= $object->writeObject(); $options['back'] = strpos($object->getStatusMessage(), 'Unsuccessful') !== false ? ' <a class="dev_option" href="javascript:history.back(1)">' . $this->getIcon('back') . 'Go back</a>' : ''; case 'new': $options['new'] = '<a href="' . $href . '?action=new">' . $this->getIcon('new') . 'Create New</a>'; $options['list'] = '<a href="' . $href . '?action=list">' . $this->getIcon('list') . 'Back to List</a>'; $action = 'post'; $output .= "<h5>Create New Entry</h5><br />"; $output .= $edit_form; break; case 'uploadfiles': $options['listfiles'] = '<a href="' . $href . '?action=listfiles&dir=' . $dir . '">' . $this->getIcon('listfiles') . 'Back to List</a>'; $options['choosefile'] = '<a href="' . $href . '?action=choosefile&dir=' . $dir . '">' . $this->getIcon('choosefile') . 'Upload Another File</a>'; $output .= dev_upload_file($_FILES['file'], 0, getcwd() . '/' . $dir); break; case 'removefile': $files->loadPostVars(); //$output .= ($files->deleteObject()) ? "Successfully Deleted Entry<br />" : "Deletion Failed<br />"; $output .= dev_delete_file($file, true) ? "Successfully Deleted Entry<br />" : "Deletion Failed<br />"; case 'listfiles': //$output .= dev_list_dir('file.php', 'document', $file_upload_dir, $query); $options['newfile'] = '<a href="' . $href . '?action=newfile&dir=' . $dir . '">' . $this->getIcon('newfile') . 'Create New File</a>'; $options['choosefile'] = '<a href="' . $href . '?action=choosefile&dir=' . $dir . '">' . $this->getIcon('choosefile') . 'Upload New File</a>'; $output .= dev_list_dir('file.php', '', $file_upload_dir, $query); case 'choosefile': $options['listfiles'] = '<a href="' . $href . '?action=listfiles&dir=' . $dir . '">' . $this->getIcon('listfiles') . 'Back to List</a>'; $output .= $upload_form; break; case 'savefile': $options['listfiles'] = '<a href="' . $href . '?action=listfiles&dir=' . $dir . '">' . $this->getIcon('listfiles') . 'Back to List</a>'; $output .= dev_save_file($file, $data); case 'openfile': $options['listfiles'] = '<a href="' . $href . '?action=listfiles&dir=' . $dir . '">' . $this->getIcon('listfiles') . 'Back to List</a>'; $options['editfile'] = '<a href="' . $href . '?action=editfile&dir=' . $dir . '&file=' . $file . '">' . $this->getIcon('editfile') . 'Back to List</a>'; $output .= $view_file_form; break; case 'newfile': case 'editfile': $output .= $edit_file_form; break; case 'upload': //Case following special "files" case //$object_files->loadPostVars(); //$files = new DevObject('files'); foreach ($_FILES as $a => $b) { if ($b['size'] > 0) { $files->clearMembers(); $files->loadPostVars(); $status .= dev_upload_file($b, 1, $image_upload_dir); $object->writeObject(); } } case 'default': case 'view': $action = 'edit'; //$output .= "<h5>View Existing Entry</h5><br />"; $options['list'] = '<a href="' . $href . '?action=list">' . $this->getIcon('list') . 'Back to List</a>'; $options['edit'] = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('edit') . 'Edit</a>'; $options['delete'] = '<a href="' . $href . '?action=delete&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('delete') . 'Delete this entry</a>'; $options['files'] = '<a href="' . $href . '?action=files&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('files') . 'Upload files for this entry</a>'; $options['manageimages'] = '<a href="' . $href . '?action=manageimages&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('manageimages') . 'Manage Images</a>'; $output .= $view_form; break; case 'edit': $action = 'post'; $output .= "<h5>Edit Existing Entry</h5><br />"; $options['list'] = '<a href="' . $href . '?action=list">' . $this->getIcon('list') . 'Back to List</a>'; $options['delete'] = '<a href="' . $href . '?action=delete&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('delete') . 'Delete this entry</a>'; $options['files'] = '<a href="' . $href . '?action=files&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('files') . 'Upload files for this entry</a>'; $options['manageimages'] = '<a href="' . $href . '?action=manageimages&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('manageimages') . 'Manage Images</a>'; //$output .= $object->formField($entry_id_var, '', '', 'hidden'); $output .= $edit_form; break; case 'delete': $action = 'remove'; $options['edit'] = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('edit') . 'No, return to this entry</a>'; $output .= "<h5>Delete Existing Entry</h5><br />"; $output .= $delete_form; break; case 'files': //Special case for minutes and programs $options['edit'] = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . $_GET[$entry_id_var] . '">' . $this->getIcon('edit') . 'Return to this entry</a>'; $options['managefiles'] = '<a href="' . $href . '?action=managefiles&' . $entry_id_var . '=' . $_GET[$entry_id_var] . '">' . $this->getIcon('managefiles') . 'Manage existing uploaded files</a>'; $files = new DevObject($tables); $files->loadFreshMembers(); $action = 'upload'; $output .= $upload_form; break; case 'managefiles': //$object->setSortOrder('entry_name', 'ASC'); $files->loadGetVars(); $files->setSortOrder('files_document', 'ASC'); $files->setCondition('files_id', '>=', '1'); $options['edit'] = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . ($_GET[$entry_id_var] == '' ? $_POST[$entry_id_var] : $_GET[$entry_id_var]) . '">' . $this->getIcon('edit') . 'Return to this entry</a><br />'; $output .= '<table width="100%" border="1">'; $output .= '<tr> <td>File Name</td> <td>File Type</td> <td>Delete</td> </tr>' . "\n"; foreach ($files->createMemberArray() as $a) { $output .= '<tr> <td><a href="' . DOMAIN . SITE_ROOT . 'files/' . $a['files_document'] . '" target="_blank">' . $a['files_document'] . '</a></td> <td>' . $a['files_type'] . '</td> <td><a href="' . $href . '?action=deletefile&files_id=' . $a['files_id'] . '">Remove</a></td> </tr>' . "\n"; } $output .= '</table>'; $output .= dev_list_dir(); break; case 'deletefile': $options['managefiles'] = '<a href="' . $href . '?action=managefiles&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('managefiles') . 'No, return to this entry\'s files</a>'; $action = 'removefile'; $output .= "<h5>Delete Existing Document</h5><br />"; $output .= $delete_file_form; break; case 'changeimages': $old_image = new DevObject($table); $old_image->clearMembers(); $old_image->{$entry_id_var} = $_POST[$entry_id_var]; $old_image->loadMembers(); foreach ($old_image->getMemberArray() as $a => $b) { if ($_POST[$a] == 'NULL') { $old_image->{$a} = ''; } } $success .= $old_image->writeObject(1); case 'manageimages': //$object->loadFreshMembers(); $action = 'changeimages'; $options['new'] = '<a href="' . $href . '?action=new">' . $this->getIcon('new') . 'Create New</a>'; $options['edit'] = '<a href="' . $href . '?action=edit&' . $entry_id_var . '=' . ${$entry_id_var} . '">' . $this->getIcon('edit') . 'Return to this entry</a>'; $output .= '<span style="font-size: 11px; color: #ff0000; font-family: arial, helvitica, sans-serif;"> Select the checkbox to remove the image from this entry. </span><br />' . dev_draw_form_field('hidden', $entry_id_var, '', ${$entry_id_var}) . dev_draw_form_field('checkbox', 'entry_image', 'Main Image: ' . $entry_image, '') . dev_draw_form_field('checkbox', 'entry_image_1', 'Additional Image 1: ' . $entry_image_1, 'NULL') . dev_draw_form_field('checkbox', 'entry_image_2', 'Additional Image 2: ' . $entry_image_2, 'NULL') . dev_draw_form_field('checkbox', 'entry_image_3', 'Additional Image 3: ' . $entry_image_3, 'NULL') . dev_draw_form_field('checkbox', 'entry_image_4', 'Additional Image 4: ' . $entry_image_4, 'NULL') . dev_draw_form_field('checkbox', 'entry_image_5', 'Additional Image 5: ' . $entry_image_5, 'NULL') . dev_draw_form_field('checkbox', 'entry_image_6', 'Additional Image 6: ' . $entry_image_6, 'NULL') . dev_draw_form_field('checkbox', 'entry_image_7', 'Additional Image 7: ' . $entry_image_7, 'NULL') . dev_draw_form_field('checkbox', 'entry_image_8', 'Additional Image 8: ' . $entry_image_8, 'NULL') . '<input type="submit" value="Remove" />'; break; } $output .= dev_draw_form_field('hidden', 'action', '', $action); $output .= dev_close_form(); $status .= $object->getStatusMessage() != '' ? '<span class="dev_status">' . $object->getStatusMessage() . '</span><br />' : ''; $option_types = array_keys($options); if ($options_on === true) { foreach ($option_types as $a) { if (!in_array($a, $options_set)) { unset($options[$a]); } } } $options_str = implode(' ', $options); $this->setStatus($status); $this->setTasks($options_str); $this->setOutput($output); $output = "{$status}{$options_str}<br />{$output}"; //echo $object->getQuery(); return $output; }