Writes a common 'delete' button for a list of records.

@param   string  $msg   Postscript for the 'are you sure' message.
@param   string  $task  An override for the task.
@param   string  $alt   An override for the alt text.
@return  void
328798
public static function deleteList($msg = '', $task = 'remove', $alt = 'JTOOLBAR_DELETE')
	{
		$bar = static::getRoot();
		// Add a delete button.
		if ($msg)
		{
			$bar->appendButton('Confirm', $msg, 'delete', $alt, $task, true);
		}
		else
		{
			$bar->appendButton('Standard', 'delete', $alt, $task, true);
		}
	}
640300
public static function publish($task = 'publish', $alt = 'JTOOLBAR_PUBLISH', $check = false)
	{
		static::getRoot()->appendButton('Standard', 'publish', $alt, $task, $check);
	}
1024637
public function log($msg, $timestamp = true)
    {
        if ($timestamp) {
            $timestamp = strftime("%Y-%m-%d %H:%M:%S");
            $msg = "[{$timestamp}] {$msg}";
        }
        $this->addResult($msg);
        if ($this->verbose) echo $msg . PHP_EOL;
    }
1182885
public static function unpublish($task = 'unpublish', $alt = 'JTOOLBAR_UNPUBLISH', $check = false)
	{
		static::getRoot()->appendButton('Standard', 'unpublish', $alt, $task, $check);
	}
530869
public function addTask(Task $task)
    {
        if (!isset($this->tasks[$task->uniq])) {
            $this->tasks[$task->uniq] = $task;
            ++$this->tasksCount;
        }
    }
335443
public function log($msg, $level = Project::MSG_INFO)
    {
        if ($this->project !== null) {
            $this->project->log("[filter:" . get_class($this) . "] " . $msg, $level);
        }
    }
1338153
public static function setTypeMsg($type, $msg=null)
    {
        if (is_array($type)) {
            self::$typeMsg=array_merge(self::$typeMsg, $type);
        } else {
            self::$typeMsg[$type]=$msg;
        }
    }
599683
public static function adhoc_task_complete(adhoc_task $task) {
        global $DB;

        // Finalise the log output.
        logmanager::finalise_log();

        // Delete the adhoc task record - it is finished.
        $DB->delete_records('task_adhoc', array('id' => $task->get_id()));

        // Reschedule and then release the locks.
        if ($task->is_blocking()) {
            $task->get_cron_lock()->release();
        }
        $task->get_lock()->release();
    }
360497
public function sendMessage($title, $msg, $icon = null)
    {
        $this->notify($title, $msg, is_string($icon) ? $icon : realpath($this->icon));

        return $this;
    }
385248
public static function validText(
        $msg = '',
        $options = [],
        $default = null,
        $noValidMessage = null,
        $attemptTimes = 3,
        $failCloseMessage = false
    ) {
        $prompter = new ValidatePrompter();

        $prompter->setOptions($options);

        static::prepareCallbackPrompter($prompter, $noValidMessage, $attemptTimes, $failCloseMessage);

        return $prompter->ask($msg, $default);
    }
739150
public static function selector(
        $msg = '',
        $options = [],
        $default = null,
        $noValidMessage = null,
        $attemptTimes = 3,
        $failCloseMessage = false
    ) {
        $prompter = new SelectPrompter();

        $prompter->setOptions($options);

        static::prepareCallbackPrompter($prompter, $noValidMessage, $attemptTimes, $failCloseMessage);

        return $prompter->ask($msg, $default);
    }
1236415
public function remove(TaskInterface $task): bool
	{
		if (!$this->exists($task))
			return false;

		unset($this->tasks[array_search($task, $this->tasks)]);

		return true;
	}
558961
protected function logError(string $msg)
    {
        $this->logger->error('CMD: ' . $msg);
        $this->out->writeln("<error>$msg<error>");
    }
681897
def delete_tasks(config, task_id):
    """"""
    if task_id is None:
        msg = ("Are you sure you want to delete all the tasks and associated task runs?")
        if click.confirm(msg):
            res = _delete_tasks(config, task_id)
            click.echo(res)

        else:
            click.echo("Aborting.")
    else:
        res = _delete_tasks(config, task_id)
        click.echo(res)
1295150
protected function _die( $msg, $sql = null )
    {
        if ( $this->db )
        {
            $error = $this->db->errorInfo();
            eZDebug::writeError( $sql, "$msg: {$error[2]}" );
        }
        else
        {
            eZDebug::writeError( $sql, $msg );
        }
    }
1022794
protected function submitTask(Task $task)
    {
        switch ($task->type) {
        case Task::JOB_LOW:
            $type = 'submit_job_low';
            break;
        case Task::JOB_LOW_BACKGROUND:
            $type = 'submit_job_low_bg';
            break;
        case Task::JOB_HIGH_BACKGROUND:
            $type = 'submit_job_high_bg';
            break;
        case Task::JOB_BACKGROUND:
            $type = 'submit_job_bg';
            break;
            case Task::JOB_EPOCH:
            $type = 'submit_job_epoch';
            break;
        case Task::JOB_HIGH:
            $type = 'submit_job_high';
            break;
        default:
            $type = 'submit_job';
            break;
        }

        $arg = $task->arg;

        $params = array(
            'func' => $task->func,
            'uniq' => $task->uniq,
            'arg' => $arg,
        );

        if ($task->type == Task::JOB_EPOCH) {
            $params['epoch'] = $task->epoch;
        }

        $s = $this->getConnection();
        Connection::send($s, $type, $params);

        if (!is_array(Connection::$waiting[(int) $s])) {
            Connection::$waiting[(int) $s] = array();
        }

        array_push(Connection::$waiting[(int) $s], $task);
    }
572280
public static function clearMsg($msg)
    {
        $nmsg = str_replace([' standalone="no"', 'default:', ':default', "\n", "\r", "\t"], '', $msg);
        $nnmsg = str_replace('> ', '>', $nmsg);
        if (strpos($nnmsg, '> ')) {
            $nnmsg = self::clearMsg((string) $nnmsg);
        }

        return $nnmsg;
    }