Whether an image style can be deleted
@return bool
353582
public function canDeleteImageStyle()
    {
        return isset($this->data_imagestyle['imagestyle_id'])
            && $this->access('image_style_delete')
            && $this->image_style->canDelete($this->data_imagestyle['imagestyle_id']);
    }
1178085
public function editImageStyle($style_id = null)
    {
        $this->setImageStyle($style_id);
        $this->setTitleEditImageStyle();
        $this->setBreadcrumbEditImageStyle();

        $this->setData('imagestyle', $this->data_imagestyle);
        $this->setData('actions', $this->getActionsImageStyle());
        $this->setData('can_delete', $this->canDeleteImageStyle());

        $this->submitEditImageStyle();
        $this->setDataEditImageStyle();

        $this->outputEditImageStyle();
    }
1073644
public function actionClearRemoteImages()
    {
        $config = Plugin::$plugin->getSettings();
        $request = Craft::$app->getRequest();

        $key = $request->getParam('key', '');
        $setKey = $config->clearKey;

        if ($setKey === '' || $key != $setKey) {
            throw new \Exception('Unautorized key');
        }

        Plugin::$plugin->imager->deleteRemoteImageCaches();

        return true;
    }
987038
public function isThemeCustomizable()
    {
        $env = Environment::get();
        $r = $env->getRecord(
            DIRNAME_THEMES.'/'.$this->getThemeHandle().'/'.DIRNAME_CSS.'/'.FILENAME_STYLE_CUSTOMIZER_STYLES,
            $this->getPackageHandle()
        );

        return $r->exists();
    }
492252
protected function canDeleteUser()
    {
        return isset($this->data_user['user_id'])
            && $this->access('user_delete')
            && $this->user->canDelete($this->data_user['user_id']);
    }
975638
function canVersionRemove( )
    {
        if ( !isset( $this->Permissions['can_versionremove'] ) )
        {
            $this->Permissions['can_versionremove'] = $this->checkAccess( 'versionremove' );
        }
        return ( $this->Permissions['can_versionremove'] == 1 );
    }
929875
public function cmdClearImageStyle()
    {
        $id = $this->getParam(0);
        $all = $this->getParam('all');

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

        $result = false;

        if (isset($id)) {

            if (!is_numeric($id)) {
                $this->errorAndExit($this->text('Invalid argument'));
            }

            $result = $this->image_style->clearCache($id);
        } else if (!empty($all)) {
            $result = $this->image_style->clearCache();
        }

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

        $this->output();
    }
584472
protected function deleteImages() {
		$images_count = elgg_get_entities([
			'type' => 'object',
			'subtype' => TidypicsImage::SUBTYPE,
			'container_guid' => $this->guid,
			'count' => true,
		]);
		if ($images_count > 0) {
			$images = elgg_get_entities([
				'type' => 'object',
				'subtype' => TidypicsImage::SUBTYPE,
				'container_guid' => $this->guid,
				'limit' => false,
				'batch' => true,
				'batch_inc_offset' => false,
			]);
			foreach ($images as $image) {
				if ($image) {
					$image->delete();
				}
			}
		}
	}
998462
protected function canDeleteCity()
    {
        return isset($this->data_city['city_id'])
            && $this->access('city_delete')
            && $this->city->canDelete($this->data_city['city_id']);
    }
449773
public function deleteStyleAction()
    {
        $translator = $this->getServiceLocator()->get('translator');

        $eventDatas = array();
        $this->getEventManager()->trigger('meliscms_style_delete_start', $this, $eventDatas);

        $request = $this->getRequest();
        $templateId = null;
        $status  = 0;
        $message = 'no data';
        $textMessage = 'tr_meliscms_tool_styles_delete_fail';
        $textTitle = 'tr_meliscms_tool_styles';
        // make sure it's a POST call
        if($request->isPost()) {

            // get the service for Templates Model & Table
            $tableStyle = $this->getServiceLocator()->get('MelisEngineTableStyle');
            $styleId = (int) $request->getPost('styleId');

            // make sure our ID is not empty
            if(!empty($styleId))
            {
                $tableStyle->deleteById($styleId);
                $status = 1;
                $textMessage = 'tr_meliscms_tool_styles_delete_success';
            }
        }

        $response = array(
            'success' => $status ,
            'textTitle' => $textTitle,
            'textMessage' => $textMessage
        );

        $this->getEventManager()->trigger('meliscms_style_delete_end', $this, array_merge($response, array('typeCode' => 'CMS_STYLE_DELETE', 'itemId' => $styleId)));

        return new JsonModel($response);
    }
634942
protected function validateImageStyle()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->image_style->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Image style'));
            return false;
        }

        $this->setSubmitted('update', $data);
        return true;
    }
916737
public function delete()
    {     
        Util::delTree( $this->getPath() );
        foreach (Server::enum() as $s) {
            $tname = str_replace( THEME_DIR.'/', '', $s->templateDir );
            if ($tname == $this->name) {
                $s->setTheme();
            }
        }
    }
1329405
public function isImage(): bool
    {
        return is_resource($this->content) && in_array($this->contentType, [
            self::CONTENT_TYPE_IMAGE_JPEG, self::CONTENT_TYPE_IMAGE_PNG, self::CONTENT_TYPE_IMAGE_GIF,
        ]);
    }
755960
protected function canDeleteLanguage()
    {
        return isset($this->data_language['code'])
            && $this->access('language_delete')
            && $this->language->canDelete($this->data_language['code']);
    }
579205
public function isDelete() {
		if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {

			if ( $_SERVER['REQUEST_METHOD'] == 'DELETE' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'DELETE' ) ) {
				parse_str( file_get_contents( "php://input" ), $vars );

				if ( isset( $vars['_METHOD'] ) ) {
					unset( $vars['_METHOD'] );
				}

				$GLOBALS['_DELETE'] = $_DELETE = $vars;

				return TRUE;
			} else {
				return FALSE;
			}

		} else {
			return FALSE;
		}

	}
1282979
public function hasOnDelete()
    {
        $database = $this->getTable()->getDatabase();
        if($database instanceof Database &&
               $this->onDelete === $database->getPlatform()->getDefaultFKOnDeleteBehavior()) {
          return false;
        }

        return ($this->onDelete !== self::NONE);
    }
1041928
public function clear()
    {
        $patternKey = $this->fixKey('*');
        $list = glob($patternKey);
        foreach ($list as $file) {
            unlink($file);
        }
        return true;
    }