* Initializes the WCF.Action.Proxy object.
*/
_initProxy: function() {
+ var $actionName = '';
+ var $parts = this._actionName.split(/([A-Z][a-z0-9]+)/);
+ for (var $i = 0, $length = $parts.length; $i < $length; $i++) {
+ var $part = $parts[$i];
+ if ($part.length) {
+ if ($actionName.length) $actionName += '-';
+ $actionName += $part.toLowerCase();
+ }
+ }
+
this._proxy = new WCF.Action.Proxy({
failure: $.proxy(this._failure, this),
showLoadingOverlay: false,
success: $.proxy(this._success, this),
- url: 'index.php/' + this._actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+ url: 'index.php?' + $actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND
});
},
},
showLoadingOverlay: false,
success: $.proxy(this._success, this),
- url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+ url: 'index.php?worker-proxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
});
this._title = title;
},
this._proxy = new WCF.Action.Proxy({
showLoadingOverlay: false,
success: $.proxy(this._success, this),
- url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+ url: 'index.php?worker-proxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
});
this._redirectURL = redirectURL;
success: $.proxy(function() {
window.location = this._redirectURL;
}, this),
- url: 'index.php/CacheClear/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+ url: 'index.php?cache-clear/?t=' + SECURITY_TOKEN + SID_ARG_2ND
});
}, this)).appendTo($form);
* Handles an AJAX-based package installation.
*
* @author Alexander Ebert
- * @copyright 2001-2014 WoltLab GmbH
+ * @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
$application = $statement->fetchObject('wcf\data\application\Application');
// build redirect location
- $location = $application->getPageURL() . 'acp/?PackageList/' . SID_ARG_2ND_NOT_ENCODED;
+ $location = $application->getPageURL() . 'acp/index.php?package-list/' . SID_ARG_2ND_NOT_ENCODED;
WCF::resetZendOpcache();
$application = $statement->fetchObject('wcf\data\application\Application');
// build redirect location
- $location = $application->getPageURL() . 'acp/?PackageList/' . SID_ARG_2ND_NOT_ENCODED;
+ $location = $application->getPageURL() . 'acp/index.php?package-list/' . SID_ARG_2ND_NOT_ENCODED;
// show success
$this->data = array(
$controller = $routeData['controller'];
// validate class name
- if (!preg_match('~^[a-z0-9' . (URL_LEGACY_MODE ? '' : '\-') . ']+$~i', $controller)) {
+ if (!preg_match('~^[a-z0-9-]+$~i', $controller)) {
throw new SystemException("Illegal class name '".$controller."'");
}
$this->activeRequest = new Request($classData['className'], $classData['controller'], $classData['pageType']);
}
catch (SystemException $e) {
+ die("eek: " . $e->getMessage());
throw new IllegalLinkException();
}
}
protected function lookupController($controller, $pageType, $application) {
if (isset($this->controllers[$application]) && isset($this->controllers[$application][$pageType])) {
$ciController = mb_strtolower($controller);
- if (!URL_LEGACY_MODE) $ciController = str_replace('-', '', $ciController);
+ if (!URL_LEGACY_MODE || $this->isACPRequest) $ciController = str_replace('-', '', $ciController);
if (isset($this->controllers[$application][$pageType][$ciController])) {
return $this->controllers[$application][$pageType][$ciController];
* Adds default routes.
*/
protected function addDefaultRoutes() {
+ $acpRoute = new FlexibleRoute(true);
+ $this->addRoute($acpRoute);
+
if (URL_LEGACY_MODE) {
- $acpRoute = new Route('ACP_default', true);
- $acpRoute->setSchema('/{controller}/{id}');
- $acpRoute->setParameterOption('controller', 'Index', null, true);
- $acpRoute->setParameterOption('id', null, '\d+', true);
- $this->addRoute($acpRoute);
-
$defaultRoute = new Route('default');
$defaultRoute->setSchema('/{controller}/{id}');
$defaultRoute->setParameterOption('controller', null, null, true);
$this->addRoute($defaultRoute);
}
else {
- $acpRoute = new FlexibleRoute(true);
- $this->addRoute($acpRoute);
-
$defaultRoute = new FlexibleRoute(false);
$this->addRoute($defaultRoute);
}