Render HTML header for development views

@param HTTPRequest $httpRequest
@return string
764713
public function renderHeader($httpRequest = null)
    {
        $url = htmlentities(
            $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'],
            ENT_COMPAT,
            'UTF-8'
        );

        $debugCSS = ModuleResourceLoader::singleton()
            ->resolveURL('silverstripe/framework:client/styles/debug.css');
        $output = '<!DOCTYPE html><html><head><title>' . $url . '</title>';
        $output .= '<link rel="stylesheet" type="text/css" href="' . $debugCSS . '" />';
        $output .= '</head>';
        $output .= '<body>';

        return $output;
    }
588227
public function index(SS_HTTPRequest $request)
    {
        $this->customise(
            array(
            'Title'     => _t('Users.Register', 'Register'),
            'MetaTitle' => _t('Users.Register', 'Register'),
            'Form'      => $this->RegisterForm(),
            )
        );

        $this->extend("updateIndexAction");

        return $this->renderWith(
            array(
            "Users_Register",
            "Users",
            "Page"
            )
        );
    }
116041
public function upload(HTTPRequest $request)
    {
        if ($this->isDisabled() || $this->isReadonly()) {
            return $this->httpError(403);
        }

        // CSRF check
        $token = $this->getForm()->getSecurityToken();
        if (!$token->checkRequest($request)) {
            return $this->httpError(400);
        }

        $tmpFile = $request->postVar('Upload');
        /** @var File $file */
        $file = $this->saveTemporaryFile($tmpFile, $error);

        // Prepare result
        if ($error) {
            $result = [
                'message' => [
                    'type' => 'error',
                    'value' => $error,
                ]
            ];
            $this->getUpload()->clearErrors();
            return (new HTTPResponse(json_encode($result), 400))
                ->addHeader('Content-Type', 'application/json');
        }

        // We need an ID for getObjectFromData
        if (!$file->isInDB()) {
            $file->write();
        }

        // Return success response
        $result = [
            AssetAdmin::singleton()->getObjectFromData($file)
        ];

        // Don't discard pre-generated client side canvas thumbnail
        if ($result[0]['category'] === 'image') {
            unset($result[0]['thumbnail']);
        }
        $this->getUpload()->clearErrors();
        return (new HTTPResponse(json_encode($result)))
            ->addHeader('Content-Type', 'application/json');
    }
471128
public function remoteEditFormSchema(HTTPRequest $request)
    {
        $schemaID = $request->getURL();
        try {
            $form = $this->remoteEditForm();
            return $this->getSchemaResponse($schemaID, $form);
        } catch (InvalidUrlException $exception) {
            $errors = ValidationResult::create()
                ->addError($exception->getMessage());
            // @todo - Don't create dummy form (pass $form = null)
            $form = Form::create(null, 'Form', FieldList::create(), FieldList::create());
            $code = $exception->getCode();

            if ($code < 300) {
                $code = 500;
            }

            return $this
                ->getSchemaResponse($schemaID, $form, $errors)
                ->setStatusCode($code);
        }
    }
456297
public function renderHeader() {
		
		if ($this->title !== false) {
			echo CHtml::openTag('div', $this->headerHtmlOptions);
			if ($this->title) {
				$this->title = '<h3 class="panel-title" style="display: inline;">' . $this->title . '</h3>';

				if ($this->headerIcon) {
					if (strpos($this->headerIcon, 'icon') === false && strpos($this->headerIcon, 'fa') === false)
						$this->title = '<span class="glyphicon glyphicon-' . $this->headerIcon . '"></span> ' . $this->title;
					else
						$this->title = '<i class="' . $this->headerIcon . '"></i> ' . $this->title;
				}
				
				$this->renderButtons();
				echo $this->title;
			}
			echo '<div class="clearfix"></div>';
			echo CHtml::closeTag('div');
		}
	}
188544
protected function renderHead(TableAbstract $table, DataRequest $dataRequest)
    {
        $head = new Head();

        // Add the name row
        $row = new Row($head);
        foreach ($table->getColumns() as $column) {
            $cell = new Cell($column, $row, $column->getName());
            
            $row->addCell($cell);
        }
        
        $head->addRow($row);
        
        return $head;
    }
561220
public function reply(HTTPRequest $request)
    {
        // Extract parent comment from reply and build this way
        if ($parentID = $request->param('ParentCommentID')) {
            /** @var Comment $comment */
            $comment = DataObject::get_by_id(Comment::class, $parentID, true);
            if ($comment) {
                return $this->ReplyForm($comment);
            }
        }
        return $this->httpError(404);
    }
1335781
public function index(HTTPRequest $request)
    {
        /** @var RedirectorPage $page */
        $page = $this->data();
        if (!$this->getResponse()->isFinished() && $link = $page->redirectionLink()) {
            $this->redirect($link, 301);
        }
        return parent::handleAction($request, 'handleIndex');
    }
894574
function renderHeader(&$header) 
    {
        $hobj = new StdClass;
        $hobj->header = $header->toHtml();
        $this->_obj->sections[$this->_sectionCount] = $hobj;
        $this->_currentSection = $this->_sectionCount++;
    }
1069115
public function renderError($httpRequest, $errno, $errstr, $errfile, $errline)
    {
        if (!isset(self::$error_types[$errno])) {
            $errorTypeTitle = "UNKNOWN TYPE, ERRNO $errno";
        } else {
            $errorTypeTitle = self::$error_types[$errno]['title'];
        }
        $output = CLI::text("ERROR [" . $errorTypeTitle . "]: $errstr\nIN $httpRequest\n", "red", null, true);
        $output .= CLI::text("Line $errline in $errfile\n\n", "red");

        return $output;
    }
1284930
public function buildResponseIfApplicable(Request $httpRequest)
    {
        try {
            $redirect = $this->redirectStorage->getOneBySourceUriPathAndHost($httpRequest->getRelativePath(), $httpRequest->getBaseUri()->getHost());
            if ($redirect === null) {
                return null;
            }
            if (isset($this->featureSwitch['hitCounter']) && $this->featureSwitch['hitCounter'] === true) {
                $this->redirectStorage->incrementHitCount($redirect);
            }
            return $this->buildResponse($httpRequest, $redirect);
        } catch (\Exception $exception) {
            // Throw exception if it's a \Neos\RedirectHandler\Exception (used for custom exception handling)
            if ($exception instanceof Exception) {
                throw $exception;
            }
            // skip triggering the redirect if there was an error accessing the database (wrong credentials, ...)
            return null;
        }
    }
1313051
private function renderHeader()
    {
        if (!$this->header) {
            return "";
        }

        $row = "<tr  >";

        foreach ($this->columns as $column) {

            if (!$column->visible) {
                continue;
            }

            $css = strlen($column->headerclass) > 0 ? "class=\"{$column->headerclass}\"" : "";



            if ($column->sortable) {
                $sort = "";
                if ($column->fieldname === $this->sortf) {
                    if ($this->sortd === 'asc') {
                        $sort = 'fa fa-sort-asc';
                    } else {
                        $sort = 'fa fa-sort-desc';
                    }
                }
                $url = $this->getURLNode() . ':sort:' . $column->fieldname . ':' . ($this->sortd === 'asc' ? 'desc' : 'asc');
                $onclick = "window.location='{$url}'";
                if ($this->useajax) {
                    $onclick = "getUpdate('{$url}&ajax=true');event.returnValue=false; return false;";
                }
                $row .= ( "<th   {$css} style=\"white-space: nowrap;cursor:pointer;\" onclick=\"{$onclick}\" ><span>{$column->title}</span> <i class=\"{$sort}\"></i></th>");
            } else {

                $row .= ( "<th   {$css} ><span>{$column->title}</span></th>");
            }
        }
        $row .="</tr>";
        return $row;
    }
887167
public function index(HTTPRequest $request)
    {
        $stage = $request->param('Stage');
        if ($stage && in_array($stage, [Versioned::DRAFT, Versioned::LIVE])) {
            Versioned::set_stage($stage);
        }
        // Check for a possible CORS preflight request and handle if necessary
        // Refer issue 66:  https://github.com/silverstripe/silverstripe-graphql/issues/66
        if ($request->httpMethod() === 'OPTIONS') {
            return $this->handleOptions($request);
        }

        // Main query handling
        try {
            $manager = $this->getManager($request);
            // Parse input
            list($query, $variables) = $this->getRequestQueryVariables($request);

            // Run query
            $result = $manager->query($query, $variables);
        } catch (Exception $exception) {
            $error = ['message' => $exception->getMessage()];

            if (Director::isDev()) {
                $error['code'] = $exception->getCode();
                $error['file'] = $exception->getFile();
                $error['line'] = $exception->getLine();
                $error['trace'] = $exception->getTrace();
            }

            $result = [
                'errors' => [$error]
            ];
        }

        $response = $this->addCorsHeaders($request, new HTTPResponse(json_encode($result)));
        return $response->addHeader('Content-Type', 'application/json');
    }
1329277
public function getIsFrontend(HTTPRequest $request)
    {
        $adminPaths = static::config()->get('admin_url_paths');
        $adminPaths[] = AdminRootController::config()->get('url_base') . '/';
        $currentPath = rtrim($request->getURL(), '/') . '/';

        foreach ($adminPaths as $adminPath) {
            if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
                return false;
            }
        }

        // If using the CMS preview, do not treat the site as frontend
        if ($request->getVar('CMSPreview')) {
            return false;
        }

        return true;
    }
178264
public function renderHeader()
    {
        if ($this->min !== 0 || !$this->isAddButtonPositionHeader()) {
            return '';
        }

        $button = $this->isAddButtonPositionHeader() ? $this->renderAddButton() : '';

        $content = [];
        $content[] = Html::tag('td', '&nbsp;');

        if ($this->cloneButton) {
            $content[] = Html::tag('td', '&nbsp;');
        }

        $content[] = Html::tag('td', $button, [
            'class' => 'list-cell__button',
        ]);

        return Html::tag('thead', Html::tag('tr', implode("\n", $content)));
    }
364875
public function getSignatureContent(\TYPO3\Flow\Http\Request $httpRequest) {
		$date = $httpRequest->getHeader('Date');
		$dateValue = $date instanceof \DateTime ? $date->format(DATE_RFC2822) : '';
		$signData = $httpRequest->getMethod() . chr(10)
			. sha1($httpRequest->getContent()) . chr(10)
			. $httpRequest->getHeader('Content-Type') . chr(10)
			. $dateValue . chr(10)
			. $httpRequest->getUri();
		return $signData;
	}
293659
private function getAuthenticationHeaders(HttpRequest $request) {
		$timestamp = time();
		$version = '1';
		$path = $request->getPath();
		$securedData = $version . '|' . $this->userId . '|' . $timestamp . '|' . $request->getMethod() . '|' . $path;

		$headers = array();
		$headers['x-mac-version'] = $version;
		$headers['x-mac-userid'] = $this->userId;
		$headers['x-mac-timestamp'] = $timestamp;
		$headers['x-mac-value'] = $this->calculateHmac($securedData);
		return $headers;
	}