/**
	* edit categories
	*/
	function editcategories($row, $gtree, $categoryList)
	{
		global $option, $smartyvs, $task;
		$task        = JRequest::getCmd( 'task', 'frontpage' );
		$c = hwd_vs_Config::get_instance();

		/** define template variables **/
		$hidden_inputs = '<input type="hidden" name="option" value="com_hwdvideoshare" />
		<input type="hidden" name="id" value="'.$row->id.'" />
		<input type="hidden" name="task" value="savecat" />';

		if ($row->access_v_r == "RECURSE") { $recusel = "selected=\"selected\""; $nonesel=null; } else { $nonesel = "selected=\"selected\""; $recusel=null; }
		$access_v_r = "<select name=\"access_v_r\" size=\"1\" class=\"inputbox\">
		                   <option value=\"RECURSE\" ".$recusel.">"._HWDVIDS_YES."</option>
		                   <option value=\"0\" ".$nonesel.">"._HWDVIDS_NO."</option>
					       </select>";
		if ($row->access_u_r == "RECURSE") { $recusel = "selected=\"selected\""; } else { $nonesel = "selected=\"selected\""; }
		$access_u_r = "<select name=\"access_u_r\" size=\"1\" class=\"inputbox\">
		                   <option value=\"RECURSE\" ".$recusel.">"._HWDVIDS_YES."</option>
		                   <option value=\"0\" ".$nonesel.">"._HWDVIDS_NO."</option>
					       </select>";

		$order_by_select = '';
		$order_by_select.= '<select name="order_by" size="1" class="inputbox">
			<option value="0"'; if ($row->order_by == "0") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_GLOBAL.'</option>
			<option value="orderASC"'; if ($row->order_by == "orderASC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_ORDERING.' ASC</option>
			<option value="orderDESC"'; if ($row->order_by == "orderDESC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_ORDERING.' DESC</option>
			<option value="nameASC"'; if ($row->order_by == "nameASC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_NAME.' ASC</option>
			<option value="nameDESC"'; if ($row->order_by == "nameDESC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_NAME.' DESC</option>
			<option value="novidsASC"'; if ($row->order_by == "novidsASC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_NOVIDS.' ASC</option>
			<option value="novidsDESC"'; if ($row->order_by == "novidsDESC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_NOVIDS.' DESC</option>
			<option value="nosubsASC"'; if ($row->order_by == "nosubsASC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_NOSUBS.' ASC</option>
			<option value="nosubsDESC"'; if ($row->order_by == "nosubsDESC") { $order_by_select.= ' selected="selected"'; } $order_by_select.= '>'._HWDVIDS_SELECT_NOSUBS.' DESC</option>
		</select>';

		/** assign template variables **/
		$smartyvs->assign( "hidden_inputs" , $hidden_inputs );
		$smartyvs->assign( "header_title" , _HWDVIDS_SECTIONHEAD_CATS );
		$smartyvs->assign( "row" , $row );
		$smartyvs->assign( "categoryList" , $categoryList );
		if ($c->access_method == 0) {
			$smartyvs->assign( "print_accessgroups", 1 );
		} else {
			$smartyvs->assign( "print_accesslevels", 1 );
		}


		if ($task !== "newcat") {
			$smartyvs->assign( "print_parentcheck", 1 );
		}

		$smartyvs->assign( "category_id", $row->id );
		$smartyvs->assign( "published", hwd_vs_tools::yesnoSelectList( 'published', 'class="inputbox"', $row->published ) );
		$smartyvs->assign( "cvaccess_g", JHTML::_('select.genericlist', $gtree, 'access_v', 'size="4"', 'value', 'text', $row->access_v) ) ;
		$smartyvs->assign( "cuaccess_g", JHTML::_('select.genericlist', $gtree, 'access_u', 'size="4"', 'value', 'text', $row->access_u) );
		$smartyvs->assign( "access_v_r", $access_v_r );
		$smartyvs->assign( "access_u_r", $access_u_r );
		$smartyvs->assign( "order_by_select", $order_by_select );
		$smartyvs->assign( "cvaccess_l", hwd_vs_tools::hwdvsMultiAccess( $row->access_lev_v, 'access_lev_v[]' ) );
		$smartyvs->assign( "cuaccess_l", hwd_vs_tools::hwdvsMultiAccess( $row->access_lev_u, 'access_lev_u[]' ) );
		$smartyvs->assign( "access_b_v", hwd_vs_tools::yesnoSelectList( 'access_b_v', 'class="inputbox"', $row->access_b_v ) );
		if (!empty($row->thumbnail)) {
			$smartyvs->assign( "print_thumbnail", 1 );
			$smartyvs->assign( "thumbnail_url", $row->thumbnail );
		}

		/** display template **/
		$smartyvs->display('admin_categories_edit.tpl');
		return;
	}