public function edit($control_item = null) { // NO REDIRECT if ($control_item == null) { $control_item_id = phpgw::get_var('id'); // Edit control item if ($control_item_id > 0) { $control_item = $this->so->get_single_with_options($control_item_id); } else { $control_item = new controller_control_item(); } } // Sigurd: START as categories $cats = CreateObject('phpgwapi.categories', -1, 'controller', '.control'); $cats->supress_info = true; $control_areas = $cats->formatted_xslt_list(array('format' => 'filter', 'globals' => true, 'use_acl' => $this->_category_acl)); $control_areas_array = $control_areas['cat_list']; $control_groups_array = $this->so_control_group->get_control_group_array(); // Hack to fix display of char $what_to_do_fixed = str_replace(" ", " ", $control_item->get_what_to_do()); $control_item->set_what_to_do($what_to_do_fixed); $how_to_do_fixed = str_replace(" ", " ", $control_item->get_how_to_do()); $control_item->set_how_to_do($how_to_do_fixed); $data = array('editable' => true, 'control_item' => $control_item, 'control_areas' => $control_areas_array, 'control_groups' => $control_groups_array); $this->use_yui_editor(array('what_to_do', 'how_to_do')); phpgwapi_jquery::load_widget('core'); self::add_javascript('controller', 'controller', 'ajax.js'); self::render_template_xsl('control_item/control_item', $data); }