deletes the whole menu. Although there is a delete button on each menu option this just removes it from the list
 which is then interpreted when you save the menu as a whole.
965957
def destroy
      @menu = Menu.find(params[:id])
      @menu.destroy

      respond_to do |format|
        format.html { redirect_to admin_menus_path, notice: I18n.t("controllers.admin.menus.destroy.flash.success") }
      end
    end
210939
def clear(self):
        
        # preserve the collapse button
        super(XToolBar, self).clear()
        
        # clears out the toolbar
        if self.isCollapsable():
            self._collapseButton = QToolButton(self)
            self._collapseButton.setAutoRaise(True)
            self._collapseButton.setSizePolicy(QSizePolicy.Expanding,
                                               QSizePolicy.Expanding)
            
            self.addWidget(self._collapseButton)
            self.refreshButton()
            
            # create connection
            self._collapseButton.clicked.connect(self.toggleCollapsed)
        
        elif self._collapseButton:
            self._collapseButton.setParent(None)
            self._collapseButton.deleteLater()
            self._collapseButton = None
896389
def remove(self, option):
        
        if option in self._options:
            if len(self._options) == 1:
                # this is the last option in the list so clear it
                self.clear()
            else:
                self._options.remove(option)
                self._refresh_options()
                # have we just removed the selected option?
                # if so set it to the first option
                if option == self.value:
                    self._set_option(self._options[0])
            return True
        else:
            return False
946839
public function clear()
    {
        if (null !== $this->aSkill) {
            $this->aSkill->removeStructureNode($this);
        }
        $this->id = null;
        $this->type = null;
        $this->skill_id = null;
        $this->title = null;
        $this->descendant_class = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
561754
function() {

      var x, y, data, els, el, refs, actions;

      els = document.querySelectorAll('[hashedit]');
      data = [];

      for (x = 0; x < els.length; x += 1) {

        // remove action
        actions = els[x].querySelectorAll('.hashedit-edit');

        for(y=0; y<actions.length; y++) {
          actions[y].parentNode.removeChild(actions[y]);
        }

        // remove action
        actions = els[x].querySelectorAll('.hashedit-move');

        for(y=0; y<actions.length; y++) {
          actions[y].parentNode.removeChild(actions[y]);
        }

        // remove action
        actions = els[x].querySelectorAll('.hashedit-properties');

        for(y=0; y<actions.length; y++) {
          actions[y].parentNode.removeChild(actions[y]);
        }

        // remove action
        actions = els[x].querySelectorAll('.hashedit-remove');

        for(y=0; y<actions.length; y++) {
          actions[y].parentNode.removeChild(actions[y]);
        }

        // remove block menus
        actions = els[x].querySelectorAll('.hashedit-block-menu');

        for(y=0; y<actions.length; y++) {
          actions[y].parentNode.removeChild(actions[y]);
        }

        // remove block menus
        actions = els[x].querySelectorAll('.hashedit-element-menu');

        for(y=0; y<actions.length; y++) {
          actions[y].parentNode.removeChild(actions[y]);
        }

        // remove attributes
        actions = els[x].querySelectorAll('[hashedit-block]');

        for(y=0; y<actions.length; y++) {
          actions[y].removeAttribute('hashedit-block');
        }

        // remove attributes
        actions = els[x].querySelectorAll('[hashedit-element]');

        for(y=0; y<actions.length; y++) {
          actions[y].removeAttribute('hashedit-element');
        }

        // remove attributes
        actions = els[x].querySelectorAll('[hashedit-sortable]');

        for(y=0; y<actions.length; y++) {
          actions[y].removeAttribute('hashedit-sortable');
        }

        // remove attributes
        actions = els[x].querySelectorAll('[hashedit-empty]');

        for(y=0; y<actions.length; y++) {
          actions[y].removeAttribute('hashedit-empty');
        }

        // remove attributes
        actions = els[x].querySelectorAll('[contenteditable]');

        for(y=0; y<actions.length; y++) {
          actions[y].removeAttribute('contenteditable');
        }

        // remove attributes
        actions = els[x].querySelectorAll('[current-hashedit-element]');

        for(y=0; y<actions.length; y++) {
          actions[y].removeAttribute('current-hashedit-element');
        }


        el = {
          'selector': els[x].getAttribute('hashedit-selector'),
          'html': els[x].innerHTML
        };

        if(hashedit.debug === true) {
          console.log('update array');
          console.log(el);
        }

        data.push(el);
      }

      return {
        url: hashedit.url,
        changes: data
      };

    }
433917
public function clear()
    {
        if (null !== $this->aCategory) {
            $this->aCategory->removeC2P($this);
        }
        if (null !== $this->aPage) {
            $this->aPage->removeC2P($this);
        }
        $this->category_id = null;
        $this->page_id = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
1264570
public function clear()
    {
        $this->id = null;
        $this->code = null;
        $this->created_at = null;
        $this->updated_at = null;
        $this->version = null;
        $this->version_created_at = null;
        $this->version_created_by = null;
        $this->person_function_link_ids = null;
        $this->person_function_link_ids_unserialized = null;
        $this->person_function_link_versions = null;
        $this->person_function_link_versions_unserialized = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
894439
function () {
            removeButtonEventHandlers.call(this);

            this._aButtons = null;

            var aForms = this.element.getElementsByTagName("form"),
                oForm;

            if (aForms.length > 0) {
                oForm = aForms[0];

                if (oForm) {
                    Event.purgeElement(oForm);
                    if (oForm.parentNode) {
                        oForm.parentNode.removeChild(oForm);
                    }
                    this.form = null;
                }
            }
            Dialog.superclass.destroy.call(this);
        }
790588
public void clearButtonsLeft() {

        m_itemsLeft.removeAllComponents();
        m_leftButtons.removeAllComponents();
        // in case the app title is set, make sure to keep the label in the button bar
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_appIndicator.getValue())) {
            m_itemsLeft.addComponent(m_appIndicator);
        }
        updateFoldingThreshhold();
    }
1111829
def deselect_all(self):
        
        if not self.is_multiple:
            raise NotImplementedError("You may only deselect all options of a multi-select")
        for opt in self.options:
            self._unsetSelected(opt)
899132
public function clear()
    {
        if (null !== $this->aSource) {
            $this->aSource->removeCategory($this);
        }
        $this->id = null;
        $this->source_id = null;
        $this->pageid = null;
        $this->title = null;
        $this->files = null;
        $this->subcats = null;
        $this->pages = null;
        $this->size = null;
        $this->hidden = null;
        $this->created_at = null;
        $this->updated_at = null;
        $this->tree_left = null;
        $this->tree_right = null;
        $this->tree_level = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
811075
public function clear()
    {
        $this->id = null;
        $this->attribute_id = null;
        $this->attribute_type_id = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
680814
public function delete($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($menu->handler === 'Menu' && $this->Menus->delete($menu)) {
            $this->Flash->success(__d('menu', 'Menu has been successfully deleted!'));
        } else {
            $this->Flash->danger(__d('menu', 'Menu could not be deleted, please try again'));
        }

        $this->title(__d('menu', 'Delete Menu'));
        $this->redirect($this->referer());
    }
1350197
def delete(self):
        

        if self.oracle:
            self.oracle.delete()
            self.oracle = None

        if self.tot:
            self.tot.delete()
            self.tot = None
1204150
public function delete()
	{
		parent::delete();

		$item = $this->getView()->item;
		$fs = $this->getContext()->getFilesystemManager()->get( 'fs-secure' );

		foreach( $item->getListItems( 'attribute', 'hidden', 'download', false ) as $listItem )
		{
			$refItem = $listItem->getRefItem();

			if( $refItem !== null && $refItem->getCode() != '' && $fs->has( $refItem->getCode() ) ) {
				$fs->rm( $refItem->getCode() );
			}

			$item->deleteListItem( 'attribute', $listItem, $refItem );
		}
	}
38363
public function clear()
    {
        $this->id = null;
        $this->active = null;
        $this->filtertype = null;
        $this->code = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
486751
def remove(cookbook)
      return unless has_cookbook?(cookbook.name, cookbook.version)
      _cookbooks[cookbook.name].delete(cookbook.version)
    end