public function cmdDeleteLanguage()
    {
        $id = $this->getParam(0);
        $all = $this->getParam('all');

        if (!isset($id) && empty($all)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $result = false;

        if (isset($id)) {
            $result = $this->language->delete($id);
        } else if (!empty($all)) {

            $deleted = $count = 0;

            foreach ($this->language->getList(array('in_database' => true)) as $language) {
                $count++;
                $deleted += (int) $this->language->delete($language['code']);
            }

            $result = $count && $count == $deleted;
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        $this->output();
    }