static function RunPopup() { utopia::SetTitle('Browse Media'); uEvents::RemoveCallback('ProcessDomDocument', 'uAdminBar::ProcessDomDocument'); utopia::UseTemplate(TEMPLATE_BLANK); utopia::$noSnip = true; $o = utopia::GetInstance('fileManager'); $o->_RunModule(); }
static function PageNotFound($title = '404 Not Found', $content = 'The page you requested could not be found. Return to the <a href="{home_url}">homepage</a>.') { header("HTTP/1.0 404 Not Found", true, 404); utopia::SetTitle($title); if ($title) { echo "<h1>{$title}</h1>"; } if ($content) { echo "<p>{$content}</p>"; } self::AddMetaTag('robots', 'noindex'); die; }
public function RunModule() { uEvents::AddCallback('ProcessDomDocument', array($this, 'ProcessDomDocument')); if (isset($_GET['news_id'])) { $rec = $this->LookupRecord($_GET['news_id']); if (!$rec) { utopia::PageNotFound(); } utopia::SetTitle($rec['heading']); utopia::SetDescription($rec['description']); $n = array(); if ($rec['noindex']) { $n[] = 'noindex'; } if ($rec['nofollow']) { $n[] = 'nofollow'; } if ($n) { utopia::AddMetaTag('robots', implode(',', $n)); } echo '{widget.' . modOpts::GetOption('news_widget_article') . '}'; return; } if (isset($_GET['tags'])) { utopia::SetTitle('Latest ' . ucwords($_GET['tags']) . ' News'); } echo '{widget.' . modOpts::GetOption('news_widget_archive') . '}'; }
static function DownMaintenance() { $rc = '/' . ltrim(preg_replace('/^' . preg_quote(PATH_REL_ROOT, '/') . '/', '', PATH_REL_CORE), '/'); utopia::UseTemplate($rc . 'themes/install'); header("HTTP/1.0 503 Service Unavailable", true, 503); utopia::SetTitle('Website Down For Maintenance'); echo '<h1>We Will Be Back Soon</h1>'; echo '<p>We are currently unavailable while we make upgrades to improve our service to you. We'll return very soon.</p>'; echo '<p>We apologise for the inconvenience and appreciate your patience.<p>'; echo '<h2>Thank you!</h2>'; utopia::Finish(); }