1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-22 14:13:03 +02:00

Notice removals

This commit is contained in:
Tijn Kuyper
2012-12-16 12:28:28 +01:00
parent 9217a078fd
commit 57dbc89d18
14 changed files with 102 additions and 99 deletions

View File

@@ -138,13 +138,13 @@ class eFront
$c++;
if($c > 100)
{
throw new eException("Too much dispatch loops", 1);
throw new eException("Too much dispatch loops", 1);
}
// dispatched status true on first loop
$router->checkLegacy($request);
// dispatched by default - don't allow legacy to alter dispatch status
// dispatched by default - don't allow legacy to alter dispatch status
$request->setDispatched(true);
// legacy mod - return control to the bootstrap
@@ -164,7 +164,7 @@ class eFront
exit;
}
} while (!$request->isDispatched());
}
@@ -715,9 +715,9 @@ class eDispatcher
$search = array('core', 'plugin', 'override');
foreach ($search as $location)
{
{
$_searchArray = vartrue($searchArray[$location], array());
if(in_array($module, $_searchArray)) return $location;
if(in_array($module, $_searchArray)) return $location;
}
return null;
}
@@ -878,10 +878,10 @@ class eRouter
$rules = array();
foreach ($config as $module => $c)
{
{
$rules[$module] = $c['rules'];
unset($config[$module]['rules']);
$config[$module] = $config[$module]['config'];
$config[$module] = $config[$module]['config'];
}
$this->_globalConfig = $config;
$this->setRuleSets($rules);
@@ -906,7 +906,7 @@ class eRouter
$config = array();
foreach ($active as $module => $location)
{
{
$_config = array();
$obj = eDispatcher::getConfigObject($module, $location);
$path = eDispatcher::getConfigPath($module, $location, true);
@@ -932,10 +932,10 @@ class eRouter
if(!is_array($rule))
{
$_config['rules'][$pattern] = array($rule);
}
}
}
$config[$module] = $_config;
$config[$module] = $_config;
}
if($save)
@@ -970,8 +970,8 @@ class eRouter
$c = eRouter::file2config($file, $location);
if($c) $ret[] = $c;
continue;
}
$ret[] = eRouter::file2config($file, $location);
}
$ret[] = eRouter::file2config($file, $location);
}
return $ret;
}
@@ -1285,7 +1285,7 @@ class eRouter
* @param array $currentConfig url_config core preference
* @return array cleaned aliases
*/
public static function adminSyncAliases($currentAliases, $currentConfig)
public static function adminSyncAliases($currentAliases, $currentConfig)
{
if(empty($currentAliases)) return array();
@@ -1298,7 +1298,7 @@ class eRouter
if(is_array($currentAliases))
{
foreach ($currentAliases as $lanCode => $aliases)
{
{
$lanName = $lng->convert($lanCode);
if(!$lanName || !in_array($lanName, $lanList))
{
@@ -1308,9 +1308,9 @@ class eRouter
// remove non-existing modules
foreach ($aliases as $alias => $module)
{
if(!isset($currentConfig[$module])) unset($currentAliases[$lanCode][$alias]);
}
{
if(!isset($currentConfig[$module])) unset($currentAliases[$lanCode][$alias]);
}
}
}
return $currentAliases;
@@ -1514,11 +1514,11 @@ class eRouter
foreach ($rules as $pattern => $set)
{
foreach ($map as $key => $value)
{
{
if(!isset($set[$value]) && isset($config[$key]))
{
$set[$value] = $config[$key];
}
}
}
$this->_parsedRules[$module][$pattern] = $this->createRule($set, $pattern);
}
@@ -1555,9 +1555,9 @@ class eRouter
$this->_urlFormat = self::FORMAT_GET;
}
else
{
{
$rawPathInfo = rawurldecode($request->getPathInfo());
//$this->_urlFormat = self::FORMAT_PATH;
//$this->_urlFormat = self::FORMAT_PATH;
}
// Route to front page - index/index/index route
@@ -1666,12 +1666,12 @@ class eRouter
if($rule->allowVars)
{
foreach ($rule->allowVars as $key)
{
{
if(isset($_GET[$key]) && !$request->isRequestParam($key))
{
// sanitize
$vars->$key = preg_replace('/[^\d\w\-]/', '', $_GET[$key]);
}
}
}
}
$obj->legacyQueryString = e107::getParser()->simpleParse($rule->legacyQuery, $vars, '0');
@@ -1701,7 +1701,7 @@ class eRouter
}
// final fallback
if(!$route)
if(!vartrue($route))
{
if($request->routed)
{
@@ -1866,8 +1866,8 @@ class eRouter
if(isset($route[1]) && $route[1] === '*') $route[1] = $request->getController();
}
else
{
$route = explode('/', $route, 3);
{
$route = explode('/', $route, 3);
}
// we don't know anything about this route, just build it blind
@@ -1883,16 +1883,16 @@ class eRouter
# fill in index when needed - XXX not needed, may be removed soon
switch (count($route))
{
case 1:
{
case 1:
$route[1] = 'index';
$route[2] = 'index';
break;
$route[2] = 'index';
break;
case 2:
$route[2] = 'index';
break;
break;
}
# aliases
@@ -1936,8 +1936,8 @@ class eRouter
if(!$this->isMainModule($module)) $route = $alias;
}
elseif (!$this->isMainModule($module))
{
$route = $alias.'/'.$route;
{
$route = $alias.'/'.$route;
}
}
@@ -1973,7 +1973,7 @@ class eRouter
if (($url = $rule->createUrl($this, array($route[1], $route[2]), $params, $options)) !== false) return $base.rtrim(($this->isMainModule($module) ? '' : $alias.'/').$url, '/').$anc;
}
}
// default - module/controller/action
if($this->isMainModule($module)) unset($route[0]);
if($route[2] == 'index')
@@ -2020,8 +2020,8 @@ class eRouter
$params = array();
$params[$this->routeVar] = implode('/', $route);
foreach ($copy as $key => $value)
{
$params[$key] = $value;
{
$params[$key] = $value;
}
unset($copy);
$route = array();
@@ -2648,8 +2648,8 @@ class eController
->init();
}
/**
* Custom init, always called in the constructor, no matter what is the request dispatch status
/**
* Custom init, always called in the constructor, no matter what is the request dispatch status
*/
public function init() {}
@@ -2759,7 +2759,7 @@ class eController
}
}
else
{
{
//TODO not found method by controller or default one
$action = substr($actionMethodName, 6);
throw new eException('Action "'.$action.'" does not exist');
@@ -2815,11 +2815,11 @@ class eController
$oldRoute = $request->getRoute();
$route = explode('/', trim($route, '/'));
switch (count($route)) {
case 3:
switch (count($route)) {
case 3:
if($route[0] !== '*') $request->setModule($route[0]);
if($route[1] !== '*') $request->setController($route[1]);
$request->setAction($route[2]);
$request->setAction($route[2]);
break;
case 2:
@@ -2829,11 +2829,11 @@ class eController
case 1:
$request->setAction($route[0]);
break;
default:
return;
break;
break;
default:
return;
break;
}
$request->addRouteHistory($oldRoute);
@@ -2942,14 +2942,14 @@ class eControllerFront extends eController
*/
final protected function _init()
{
// plugin check
if(null !== $this->plugin)
{
if(!e107::isInstalled($this->plugin))
{
$this->forward403();
return;
}
// plugin check
if(null !== $this->plugin)
{
if(!e107::isInstalled($this->plugin))
{
$this->forward403();
return;
}
}
// global controller restriction
@@ -3936,7 +3936,7 @@ class eResponse
{
$attrData .= '<meta';
foreach ($attr as $p => $v)
{
{
$attrData .= ' '.preg_replace('/[^\w\-]/', '', $p).'="'.str_replace(array('"', '<'), '', $v).'"';
}
$attrData .= ' />'."\n";
@@ -4229,15 +4229,15 @@ class eHelper
}
$tp = e107::getParser();
switch ($type)
{
case 'dashl': //dasherize, to lower case
return self::dasherize($tp->ustrtolower($title));
{
case 'dashl': //dasherize, to lower case
return self::dasherize($tp->ustrtolower($title));
break;
case 'dashc': //dasherize, camel case
return self::dasherize(self::camelize($title, true, ' '));
break;
case 'dash': //dasherize
return self::dasherize($title);
break;
@@ -4266,10 +4266,10 @@ class eHelper
return str_replace(' ', '+', $title);
break;
case 'none':
default:
return $title;
break;
case 'none':
default:
return $title;
break;
}
}