Beispiel #1
0
 if ($_POST['close'] == 'false') {
     $task = 'add_search_word';
 }
 $search_word_name = smart_addslashes(trim($_POST['search_word_name']));
 if ($search_word_name == '') {
     $feedback = '<p class="Error">' . $error_missing_field . '</p>';
     $task = 'add_search_word';
 } else {
     $search_word_id = isset($_POST['search_word_id']) ? $_POST['search_word_id'] : 0;
     if ($search_word_id > 0) {
         $search_word = $cms->get_search_word_by_name($site_id, $search_word_name);
         if ($search_word && $search_word['id'] != $search_word_id) {
             $feedback = '<p class="Error">' . $fbNameExists . '</p>';
             $task = 'add_search_word';
         } else {
             $cms->update_search_word($search_word_id, $search_word_name);
         }
     } else {
         if ($cms->get_search_word_by_name($site_id, $search_word_name)) {
             $feedback = '<p class="Error">' . $fbNameExists . '</p>';
             $task = 'add_search_word';
         } else {
             if (!($search_word_id = $cms->add_search_word($site_id, $search_word_name))) {
                 $feedback = '<p class="Error">' . $strSaveError . '</p>';
             } else {
                 $cms->search_files($site['root_folder_id'], $search_word_id);
                 $feedback = "<p>" . $cms_search_files_prefix . " '" . $search_word_name . "' " . $cms_search_files_suffix . "</p>";
             }
         }
     }
     if ($search_word_id > 0 && isset($_POST['files'])) {