function testEditCatalogue_category() { actual_edit_catalogue_category($this->cat_id, 'Test_Cat', 'Cat_edit', 'Test', 1, '', '', '', 30, 60, NULL); $this->assertTrue('Testing_category' == $GLOBALS['SITE_DB']->query_value('catalogue_categories', 'c_name', array('id' => $this->cat_id))); }
/** * Standard aed_module edit actualiser. * * @param ID_TEXT The entry being edited */ function edit_actualisation($_id) { require_code('catalogues2'); $category_id = intval($_id); $catalogue_name = $GLOBALS['SITE_DB']->query_value_null_ok('catalogue_categories', 'c_name', array('id' => $category_id)); if (is_null($catalogue_name)) { warn_exit(do_lang_tempcode('MISSING_RESOURCE')); } $title = post_param('title'); $description = post_param('description', STRING_MAGIC_NULL); $notes = post_param('notes', STRING_MAGIC_NULL); $parent_id = post_param_integer('parent_id', INTEGER_MAGIC_NULL); $move_days_lower = post_param_integer('move_days_lower', INTEGER_MAGIC_NULL); $move_days_higher = post_param_integer('move_days_higher', INTEGER_MAGIC_NULL); $move_target = post_param_integer('move_target', INTEGER_MAGIC_NULL); if ($move_target == -1) { $move_target = NULL; } if (!is_null($move_target)) { if (!has_submit_permission('mid', get_member(), get_ip_address(), 'cms_catalogues', array('catalogues_catalogue', $catalogue_name, 'catalogues_category', $move_target))) { access_denied('CATEGORY_ACCESS'); } } if (!fractional_edit()) { $urls = get_url('image_url', 'rep_image', 'uploads/grepimages', 0, OCP_UPLOAD_IMAGE); $rep_image = $urls[0]; if ($rep_image == '' && post_param_integer('rep_image_unlink', 0) != 1) { $rep_image = NULL; } } else { $rep_image = STRING_MAGIC_NULL; } actual_edit_catalogue_category($category_id, $title, $description, $notes, $parent_id, post_param('meta_keywords', STRING_MAGIC_NULL), post_param('meta_description', STRING_MAGIC_NULL), $rep_image, $move_days_lower, $move_days_higher, $move_target); if (!fractional_edit()) { if (get_value('disable_cat_cat_perms') !== '1') { $this->set_permissions(strval($category_id)); } } $this->donext_category_id = $category_id; $this->donext_catalogue_name = $catalogue_name; }