static function logout($redirectUri = null) { $request = \ManiaLib\Application\Request::getInstance(); $maniaplanet = new \Maniaplanet\WebServices\ManiaConnect\Player(); $maniaplanet->logout(); $logoutURL = $maniaplanet->getLogoutURL($redirectUri ?: $request->createLink('/')); $request->redirectAbsolute($logoutURL); }
protected function __construct() { $r = \ManiaLib\Application\Request::getInstance(); $this->title = 'Dedicated Manager ' . (defined('DEDICATED_MANAGER_VERSION') ? DEDICATED_MANAGER_VERSION : '<no version>'); $this->leftText = _('Back to home'); $this->leftIcon = 'home'; $this->leftLink = $r->createLinkArgList('/'); }
static function folder(array $files, $path = '', $parentPath = '', $name = 'maps[]', array $selected = array(), $withThumbnail = false) { $r = \ManiaLib\Application\Request::getInstance(); $displayedDirs = ''; $displayedFiles = ''; foreach ($files as $file) { if ($file instanceof Directory) { /* @var $file Directory */ $r->set('path', $file->path . $file->filename . '/'); $displayedDirs .= sprintf('<li><a href="%s" data-ajax="false">%s</a></li>', $r->createLinkArgList('.', 'path'), $file->filename); } else { if ($file instanceof Map) { $checked = in_array($file->path . $file->filename, $selected); $displayedFiles .= self::map($file, $name, $checked, $withThumbnail); } } } $r->set('path', $parentPath); $str = '<ul data-role="listview" data-inset="true">' . '<li data-role="list-divider"><h3>Maps/' . $path . '</h3></li>' . ($path != $parentPath ? sprintf('<li data-icon="arrow-u" data-theme="e"><a href="%s" data-ajax="false">%s</a></li>', $r->createLinkArgList('.', 'path'), _('Parent directory')) : '') . $displayedDirs . ($displayedFiles ? '<li><fieldset data-role="controlgroup">' . $displayedFiles . '</fieldset></li>' : '') . '</ul>'; $r->restore('path'); return $str; }
protected function executeAction($actionName, $registerView = true, $resetViews = false) { $this->checkActionExists($actionName); if ($resetViews) { $this->response->resetViews(); } if ($registerView) { $this->response->registerView($this->response->getViewClassName($this->controllerName, $actionName)); } $callParameters = array(); $requiredParameters = $this->reflectionMethods[$actionName]->getParameters(); foreach ($requiredParameters as $parameter) { if ($parameter->isDefaultValueAvailable()) { $callParameters[] = $this->request->get($parameter->getName(), $parameter->getDefaultValue()); } else { $pname = $parameter->getName(); $pmessage = 'Undefined parameter: $<$o' . $pname . '$>'; $callParameters[] = $this->request->getStrict($pname, $pmessage); } } $this->actionName = $actionName; call_user_func_array(array($this, $actionName), $callParameters); }
/** * Call the parent constructor when you override it in your filters! */ function __construct() { $this->request = \ManiaLib\Application\Request::getInstance(); $this->response = \ManiaLib\Application\Response::getInstance(); $this->session = \ManiaLib\Application\Session::getInstance(); }
function savePageNavigator() { $request = \ManiaLib\Application\Request::getInstance(); if ($this->hasMorePages !== null) { if ($this->hasMorePages) { $this->setSize($this->getCurrentPage() * $this->perPage + 1); } else { $this->setSize($this->getCurrentPage() * $this->perPage); } } if ($this->getPageNumber() > 1) { $ui = $this->pageNavigator; $ui->setPageNumber($this->getPageNumber()); $ui->setCurrentPage($this->getCurrentPage()); if ($ui->isLastShown()) { $request->set($this->urlParamName, 1); call_user_func(array($ui->arrowFirst, $this->linkCallback), $request->createLink($this->urlPageName)); $request->set($this->urlParamName, $this->getPageNumber()); call_user_func(array($ui->arrowLast, $this->linkCallback), $request->createLink($this->urlPageName)); } if ($ui->isFastNextShown()) { $request->set($this->urlParamName, $this->currentPage + 5); call_user_func(array($ui->arrowFastNext, $this->linkCallback), $request->createLink($this->urlPageName)); if ($this->currentPage > 1) { $request->set($this->urlParamName, $this->currentPage - 5 < 1 ? 1 : $this->currentPage - 5); call_user_func(array($ui->arrowFastPrev, $this->linkCallback), $request->createLink($this->urlPageName)); } } if ($this->currentPage < $this->pageNumber) { $request->set($this->urlParamName, $this->currentPage + 1); call_user_func(array($ui->arrowNext, $this->linkCallback), $request->createLink($this->urlPageName)); } if ($this->currentPage > 1) { $request->set($this->urlParamName, $this->currentPage - 1); call_user_func(array($ui->arrowPrev, $this->linkCallback), $request->createLink($this->urlPageName)); } $request->set($this->urlParamName, $this->currentPage); $ui->save(); } }
$ui = new Label(100); $ui->setPosition(17, -2.5, 0); $ui->setScale(1.75); $ui->setStyle(Label::TextButtonBig); $ui->setText(maniapress_get_bloginfo('name')); $ui->save(); $ui = new Label(150); $ui->setPosition(17, -9, 0.1); $ui->setStyle(Label::TextTips); $ui->setText(maniapress_get_bloginfo('description')); $ui->save(); Manialink::endFrame(); Manialink::beginFrame(145, -8.5, 0.1); $ui = new \ManiaLib\Gui\Elements\Entry(40, 5); $ui->setName('search'); $ui->setDefault(\ManiaLib\Application\Request::getInstance()->get('s')); $ui->save(); $ui = new Icons64x64_1(6); $ui->setPosition(41, 0.5); $ui->setSubStyle(Icons64x64_1::Maximize); $ui->setManialink(maniapress_get_bloginfo('url') . '?s=search'); $ui->save(); Manialink::endFrame(); $layout = new ManiaLib\Gui\Layouts\Line(); $layout->setMarginWidth(1); Manialink::beginFrame(10, -24, 0.2, 1, $layout); // TODO MANIAPRESS Handle drop-down menus $menu = wp_get_nav_menu_object('manialink'); if ($menu) { $menu_items = wp_get_nav_menu_items($menu->term_id); foreach ((array) $menu_items as $key => $menu_item) {