{@inheritdoc}

@param int $fid
The file's numeric ID.
@param string $op
The operation, such as 'delete'.

@return string
Complete path to the page.
542554
public static function route($fid, $op = '')
    {
        $url = str_replace('%fid%', $fid, static::$URL);

        switch ($op) {
            case 'delete':
                return $url . '/delete';

            case '':
            default:
                return $url;
        }
    }
612665
protected function getPageId($pid)
    {
        $pid = (int)$pid;
        if ($pid > 0) {
            return $pid;
        }
        $row = BackendUtilityCore::getRecord('tt_content', abs($pid), 'uid,pid');
        return $row['pid'];
    }
421022
public static function create($fid, $timestamp = null)
  {
    /**
     * @var $payload MarkDatePayload
     */
    $payload = parent::create($fid);
    $payload->timestamp = $timestamp;
    return $payload;
  }
884245
public function actionGet( $id, $cid, $fid ) {

		// Find Model
		$model	= $this->modelService->getById( $cid );

		// Update/Render if exist
		if( isset( $model ) ) {

			$file = $model->image;

			$data = [
				'mid' => $model->id, 'fid' => $file->id,
				'name' => $file->name, 'extension' => $file->extension,
				'title' => $file->title, 'caption' => $file->caption,
				'altText' => $file->altText, 'link' => $file->link, 'url' => $file->getFileUrl(),
				'description' => $file->description, 'content' => $model->content
			];

			if( $file->type == 'image' ) {

				$data[ 'mediumUrl' ]	= $file->getMediumUrl();
				$data[ 'thumbUrl' ]		= $file->getThumbUrl();
			}

			// Trigger Ajax Success
			return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
		}

		// Trigger Ajax Failure
        return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ), $errors );
	}
1243695
static function deletePost( $pid ) {

		if ( false === Book::isBook() || wp_is_post_revision( $pid ) || 'auto-draft' === get_post_status( $pid ) ) {
			return false;
		}

		/** @var $wpdb \wpdb */
		global $wpdb;

		// remove chapter/part/front matter
		// decrement order of everything with a higher order, and if chapter, only within that part

		$post_to_delete = get_post( $pid );
		$order = $post_to_delete->menu_order;
		$type = $post_to_delete->post_type;
		$parent = $post_to_delete->post_parent;

		if ( 'chapter' === $type ) {
			$success = $wpdb->query(
				$wpdb->prepare(
					"UPDATE {$wpdb->posts} SET menu_order = menu_order - 1 WHERE menu_order > %d AND post_type = %s AND post_parent = %d ",
					$order,
					$type,
					$parent
				)
			);
		} else {
			$success = $wpdb->query(
				$wpdb->prepare(
					"UPDATE {$wpdb->posts} SET menu_order = menu_order - 1 WHERE menu_order > %d AND post_type = %s ",
					$order,
					$type
				)
			);
		}

		clean_post_cache( $post_to_delete );

		if ( 'part' === $type ) {

			// We're setting two things here - the new post_parent (to the first part)
			// And the new menu order for the chapters that were in the part being deleted.

			$new_parent_id = $wpdb->get_var(
				$wpdb->prepare(
					"SELECT ID FROM {$wpdb->posts} WHERE post_type = 'part' AND post_status = 'publish' AND NOT ID = %d ORDER BY menu_order LIMIT 1 ",
					$pid
				)
			);

			if ( $new_parent_id ) {
				$existing_numposts = $wpdb->get_var(
					$wpdb->prepare(
						"SELECT COUNT(1) AS numposts FROM {$wpdb->posts} WHERE post_type = 'chapter' AND post_parent = %d ",
						$new_parent_id
					)
				);
				$success = $wpdb->query(
					$wpdb->prepare(
						"UPDATE {$wpdb->posts} SET post_parent = %d, menu_order = menu_order + %d WHERE post_parent = %d AND post_type = 'chapter' ",
						$new_parent_id,
						$existing_numposts,
						$pid
					)
				);
			} else {
				$success = $wpdb->query(
					$wpdb->prepare(
						"UPDATE {$wpdb->posts} SET post_status = 'trash' WHERE post_parent = %d AND post_type = 'chapter' ",
						$pid
					)
				);
			}

			wp_cache_flush();
		}

		static::deleteBookObjectCache();

		return $success ? true : false;
	}
904310
function cmd_STOR($fd, $cmd)
    {
        $user = $this->getUser($fd);
        $ftpsock = $this->getUserSock($user);
        $file = $this->fillDirName($user, $cmd[1]);
        $this->debug("PUT: $file");
        $fp = fopen($file, "w");
        if (!$fp)
        {
            $this->send($fd, "553 Can't open that file: Permission denied");
        }
        else
        {
            $this->send($fd, "150 Connecting to client");
            while (!feof($ftpsock))
            {
                $cont = fread($ftpsock, 8192);
                if (!$cont) break;
                if (!fwrite($fp, $cont)) break;
            }
            if (fclose($fp) and $this->closeUserSock($user))
            {
                $this->send($fd, "226 File successfully transferred");
            }
            else
            {
                $this->send($fd, "550 Error during file-transfer");
            }
        }
    }
881997
function igets($fid=0,$order = 'id')
	{
		$gets['fid'] = $fid;
		$gets['order'] = $order;
		return $this->gets($gets);
	}
770189
public function actionDeleteposts($cid = null, $fid = null, $id = null, $slug = null)
    {
        $thread = (new ThreadVerifier([
            'categoryId' => $cid,
            'forumId' => $fid,
            'threadId' => $id,
            'threadSlug' => $slug
        ]))->verify();
        if (empty($thread)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        if (!User::can(Rbac::PERM_DELETE_POST, ['item' => $thread])) {
            $this->error(Yii::t('podium/flash', 'Sorry! You do not have the required permission to perform this action.'));
            return $this->redirect(['forum/index']);
        }

        $posts = Yii::$app->request->post('post');
        if ($posts) {
            if (!is_array($posts)) {
                $this->error(Yii::t('podium/flash', 'You have to select at least one post.'));
            } else {
                if ($thread->podiumDeletePosts($posts)) {
                    $this->success(Yii::t('podium/flash', 'Posts have been deleted.'));
                    if (Thread::find()->where(['id' => $thread->id])->exists()) {
                        return $this->redirect([
                            'forum/thread',
                            'cid' => $thread->forum->category->id,
                            'fid' => $thread->forum->id,
                            'id' => $thread->id,
                            'slug' => $thread->slug
                        ]);
                    }
                    return $this->redirect([
                        'forum',
                        'cid' => $thread->forum->category->id,
                        'id' => $thread->forum->id,
                        'slug' => $thread->forum->slug
                    ]);
                }
                $this->error(Yii::t('podium/flash', 'Sorry! There was an error while deleting the posts.'));
            }
        }
        return $this->render('deleteposts', [
            'model' => $thread,
            'dataProvider' => (new Post())->search($thread->forum->id, $thread->id)
        ]);
    }
451184
public function findById($id)
    {
        if(!file_exists($path = $this->getPathForDocument($id))) {
            return false;
        }

        $fp       = fopen($path, 'r');
        $contents = fread($fp, filesize($path));
        fclose($fp);

        $data = $this->formatter->decode($contents);

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

        $ext = $this->formatter->getFileExtension();

        $doc = new $this->documentClass((array) $data);
        $doc->setId($this->getIdFromPath($path, $ext));

        return $doc;
    }
302581
public function loadById($pId)
    {
        if (! $pId instanceof Id) {
            $id = new Id($pId);
        } else {
            $id = $pId;
        }

        return $this->_loadByAttribute(static::IDFIELD, $id->getOrig());
    }
1123333
protected function check_post_id( $pid ) {
		if ( is_numeric($pid) && $pid === 0 ) {
			$pid = get_the_ID();
			return $pid;
		}
		if ( !is_numeric($pid) && is_string($pid) ) {
			$pid = PostGetter::get_post_id_by_name($pid);
			return $pid;
		}
		if ( !$pid ) {
			return null;
		}
		return $pid;
	}
329400
public function getDelete($isadmin, $userid, $del, $commid)
    {
        $delete = "";
        if ($isadmin || $userid == $this->sess['id']) {
            $delete = ' | <a href="' .  $del . '/' . $commid . '">Ta bort inlägget</a></p>';
        }
        return $delete;
    }
461875
public function getIdByPath($module)
    {
        $moduleId = null;
        $moduleFile = $module;
        $moduleId = $this->getIdFromExtension($module);
        if (!$moduleId) {
            $modulePaths = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModulePaths');

            if (is_array($modulePaths)) {
                foreach ($modulePaths as $id => $path) {
                    if (strpos($moduleFile, $path . "/") === 0) {
                        $moduleId = $id;
                    }
                }
            }
        }
        if (!$moduleId) {
            $moduleId = substr($moduleFile, 0, strpos($moduleFile, "/"));
        }
        if (!$moduleId) {
            $moduleId = $moduleFile;
        }

        return $moduleId;
    }
314795
protected function removePidFileByPid(int $pid) : bool
    {
        foreach ($this->pids as $pool => $poolPids) {
            foreach ($poolPids as $workerId => $workerPid) {
                if ($pid !== $workerPid) {
                    continue;
                }
                $pidFile = $this->runPath .'/'.$pool.'/'.$pid.'.pid';
                return $this->removePidFile($pidFile);
            }
        }
        return false;
    }
786764
public static function getByID($fsID)
    {
        $db = Database::connection();
        $row = $db->fetchAssoc('SELECT * FROM FileSets WHERE fsID = ?', array($fsID));
        if (is_array($row)) {
            $fs = new static();
            $fs = array_to_object($fs, $row);
            if ($row['fsType'] == static::TYPE_SAVED_SEARCH) {
                $row2 = $db->GetRow(
                    'SELECT fsSearchRequest, fsResultColumns FROM FileSetSavedSearches WHERE fsID = ?',
                    array($fsID));
                $fs->fsSearchRequest = @unserialize($row2['fsSearchRequest']);
                $fs->fsResultColumns = @unserialize($row2['fsResultColumns']);
            }

            return $fs;
        }
    }
735223
public function deleteDirectoryById($id)
    {
        $public = $id[strlen($id)-1] == '+';
        $path = $this->id2path($id);
        return $this->getServiceLocator()->get(FileSystemService::SERVICE_ID)->getFileSystem($this->getFsId($public))->deleteDir($path);
    }
841217
public static function getRelativePathFromID($fID)
    {
        $result = false;
        if ($fID) {
            $cache = Application::getFacadeApplication()->make('cache/request');
            /** @var \Concrete\Core\Cache\Cache $cache */
            if ($cache->isEnabled()) {
                $cacheItem = $cache->getItem('file_relative_path/' . $fID);
                if (!$cacheItem->isMiss()) {
                    return $cacheItem->get();
                }
            }
            $f = static::getByID($fID);
            if ($f !== null) {
                $result = $f->getRelativePath();
                if (isset($cacheItem)) {
                    $cacheItem->set($result)->save();
                }
            }
        }

        return $result;
    }