public function getPageContent(Website $website, Request $request) { // Don't allow to edit your own rank (why would admins want to downgrade // themselves?) if (!$this->editing_someone_else) { $website->addError($website->t("users.account") . " " . $website->t("errors.not_editable")); return ""; } $show_form = true; $textToDisplay = ""; if ($request->hasRequestValue("rank")) { // Sent $rank = $request->getRequestInt("rank"); $oAuth = $website->getAuth(); if ($oAuth->isValidRankForAccounts($rank)) { // Valid rank id $this->user->setRank($rank); $userRepo = $website->getAuth()->getUserRepository(); $userRepo->save($this->user); // Saved $textToDisplay .= '<p>' . $website->t("users.rank") . ' ' . $website->t("editor.is_changed") . '</p>'; // Don't show form $show_form = false; } else { // Invalid rank $website->addError($website->t("users.rank") . ' ' . $website->t("errors.not_found")); $textToDisplay .= '<p><em>' . $website->tReplacedKey("errors.your_input_has_not_been_changed", "users.rank", true) . '</em></p>'; } } // Show form if ($show_form) { // Variables $rank = $request->getRequestInt("rank", $this->user->getRank()); $ranks = array(Authentication::RANK_USER, Authentication::RANK_MODERATOR, Authentication::RANK_ADMIN); // Form itself $textToDisplay .= <<<EOT <p> {$website->t("users.rank.edit.explained")} {$website->tReplaced("accounts.edit_other", "<strong>" . $this->user->getDisplayName() . "</strong>")} </p> <p> {$website->t("main.fields_required")} </p> <form action="{$website->getUrlMain()}" method="post"> <p> <label for="rank">{$website->t("users.rank")}</label>:<span class="required">*</span><br /> {$this->get_ranks_box_html($website, $ranks, $rank)} </p> <p> <input type="hidden" name="p" value="edit_rank" /> <input type="hidden" name="id" value="{$this->user->getId()}" /> <input type="submit" value="{$website->t('users.rank.edit')} " class="button" /> </p> </form> EOT; } // Links $textToDisplay .= $this->get_account_links_html($website); return $textToDisplay; }
$dateTime = DateTime::createFromFormat("n Y", $selectedMonth . " " . $selectedYear); //OBJECTEN $oArticles = new ArticleRepository($website); $articles = $oArticles->getArticlesDataCalendarMonth($dateTime); $calendarTemplate = new DatePickerTemplate($website->getText(), $dateTime, $articles); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="<?php echo $website->getUrlActiveTheme(); ?> main.css" rel="stylesheet" type="text/css" /> <link href="<?php echo $website->getUrlMain(); ?> whitebackground.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<?php echo $website->getUrlJavaScripts(); ?> tooltip.js"> </script> <title><?php echo $website->t("calendar.pick_a_date"); ?> </title> </head> <body> <div> <?php $stream = new Stream("php://output", 'w');
$textToDisplay .= " <title>" . htmlSpecialChars($article->getTitle()) . "</title>\n"; $textToDisplay .= " <link>" . $website->getUrlPage('article', $article->getId()) . "</link>\n"; $textToDisplay .= " <description>" . htmlSpecialChars($article->getIntro()) . "</description>\n"; $textToDisplay .= " <pubDate>" . htmlSpecialChars($pubdate) . "</pubDate>\n"; $textToDisplay .= " <author>" . htmlSpecialChars($article->author) . "</author>\n"; $textToDisplay .= " <image>" . htmlSpecialChars($article->featuredImage) . "</image>\n"; $textToDisplay .= " <category>" . htmlSpecialChars($article->category) . "</category>\n"; $textToDisplay .= "</item>\n\n"; } } unset($article, $articles); // Show it echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?> <rss version="2.0"> <channel> <title><?php echo htmlSpecialChars($website->getConfig()->get('title')); ?> </title> <link><?php echo htmlSpecialChars($website->getUrlMain()); ?> </link> <?php echo $textToDisplay; ?> </channel> </rss> <?php