} else { if (!$cms->update_template_item($template_item_id, $name, $_POST['content'])) { $feedback = '<p class="Error">' . $strSaveError . '</p>'; } } } else { if ($cms->get_template_item_by_name($template_id, $name)) { $feedback = '<p class="Error">' . $fbNameExists . '</p>'; } else { if (!($template_item_id = $cms->add_template_item($template_id, $name, $_POST['content']))) { $feedback = '<p class="Error">' . $strSaveError . '</p>'; } } } if ($cms->get_template_items($template_id) == 1) { $cms->set_main_template_item($template_id, $template_item_id); } if ($_POST['close'] == 'true') { $task = ''; } } } break; case 'upload': if ($_SERVER['REQUEST_METHOD'] == 'POST') { $active_tab = 2; $task = 'list'; if (isset($_FILES['file'])) { for ($i = 0; $i < count($_FILES['file']['tmp_name']); $i++) { if (is_uploaded_file($_FILES['file']['tmp_name'][$i])) { $name = $_FILES['file']['name'][$i];