Permalink
Browse files

Fixed issue [#20907] Making Joomla more compliant to PHP strict standard

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@17859 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
  • Loading branch information...
1 parent a1f9245 commit 38c5d38a75fb7f3d3f0c2c921a8a2670071a30a6 @eddieajau eddieajau committed Jun 23, 2010
@@ -29,18 +29,22 @@ public function parse(&$uri)
/**
* Function to convert an internal URI to a route
*
- * @param string The internal URL
+ * @param string $uri The internal URL
+ *
* @return string The absolute search engine friendly URL
* @since 1.5
*/
- function &build($url)
+ function build($url)
{
- //Create the URI object
- $uri =& parent::build($url);
+ // Create the URI object
+ $uri = parent::build($url);
+
// Get the path data
$route = $uri->getPath();
+
//Add basepath to the uri
$uri->setPath(JURI::base(true).'/'.$route);
+
return $uri;
}
}
@@ -18,7 +18,6 @@
*/
abstract class JToolBarHelper
{
-
/**
* Title cell.
* For the title and toolbar to be rendered correctly,
@@ -38,7 +37,7 @@ public static function title($title, $icon = 'generic.png')
$html .= "$title\n";
$html .= "</h2></div>\n";
- $app = &JFactory::getApplication();
+ $app = JFactory::getApplication();
$app->set('JComponentTitle', $html);
}
@@ -50,7 +49,7 @@ public static function title($title, $icon = 'generic.png')
*/
public static function spacer($width = '')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a spacer.
$bar->appendButton('Separator', 'spacer', $width);
}
@@ -62,7 +61,7 @@ public static function spacer($width = '')
*/
public static function divider()
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a divider.
$bar->appendButton('Separator', 'divider');
}
@@ -79,7 +78,7 @@ public static function divider()
*/
public static function custom($task = '', $icon = '', $iconOver = '', $alt = '', $listSelect = true)
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Strip extension.
$icon = preg_replace('#\.[^.]*$#', '', $icon);
@@ -113,7 +112,7 @@ public static function customX($task = '', $icon = '', $iconOver = '', $alt = ''
*/
public static function preview($url = '', $updateEditors = false)
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a preview button.
$bar->appendButton('Popup', 'preview', 'Preview', $url.'&task=preview');
}
@@ -127,7 +126,7 @@ public static function preview($url = '', $updateEditors = false)
*/
public static function help($ref, $com = false)
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a help button.
$bar->appendButton('Help', $ref, $com);
}
@@ -142,7 +141,7 @@ public static function help($ref, $com = false)
*/
public static function back($alt = 'Back', $href = 'javascript:history.back();')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a back button.
$bar->appendButton('Link', 'back', $alt, $href);
}
@@ -156,7 +155,7 @@ public static function back($alt = 'Back', $href = 'javascript:history.back();')
*/
public static function media_manager($directory = '', $alt = 'Upload')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an upload button.
$bar->appendButton('Popup', 'upload', $alt, 'index.php?option=com_media&tmpl=component&task=popupUpload&directory='.$directory, 640, 520);
}
@@ -170,7 +169,7 @@ public static function media_manager($directory = '', $alt = 'Upload')
*/
public static function makeDefault($task = 'default', $alt = 'Default')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a default button.
$bar->appendButton('Standard', 'default', $alt, $task, true);
}
@@ -184,7 +183,7 @@ public static function makeDefault($task = 'default', $alt = 'Default')
*/
public static function assign($task = 'assign', $alt = 'Assign')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an assign button.
$bar->appendButton('Standard', 'assign', $alt, $task, true);
}
@@ -198,7 +197,7 @@ public static function assign($task = 'assign', $alt = 'Assign')
*/
public static function addNew($task = 'add', $alt = 'New')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a new button.
$bar->appendButton('Standard', 'new', $alt, $task, false);
}
@@ -226,7 +225,7 @@ public static function addNewX($task = 'add', $alt = 'New')
*/
public static function publish($task = 'publish', $alt = 'Publish')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a publish button.
$bar->appendButton('Standard', 'publish', $alt, $task, false);
}
@@ -240,7 +239,7 @@ public static function publish($task = 'publish', $alt = 'Publish')
*/
public static function publishList($task = 'publish', $alt = 'Publish')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a publish button (list).
$bar->appendButton('Standard', 'publish', $alt, $task, true);
}
@@ -254,7 +253,7 @@ public static function publishList($task = 'publish', $alt = 'Publish')
*/
public static function unpublish($task = 'unpublish', $alt = 'Unpublish')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an unpublish button
$bar->appendButton('Standard', 'unpublish', $alt, $task, false);
}
@@ -268,7 +267,7 @@ public static function unpublish($task = 'unpublish', $alt = 'Unpublish')
*/
public static function unpublishList($task = 'unpublish', $alt = 'Unpublish')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an unpublish button (list).
$bar->appendButton('Standard', 'unpublish', $alt, $task, true);
}
@@ -282,7 +281,7 @@ public static function unpublishList($task = 'unpublish', $alt = 'Unpublish')
*/
public static function archiveList($task = 'archive', $alt = 'Archive')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an archive button.
$bar->appendButton('Standard', 'archive', $alt, $task, true);
}
@@ -296,7 +295,7 @@ public static function archiveList($task = 'archive', $alt = 'Archive')
*/
public static function unarchiveList($task = 'unarchive', $alt = 'Unarchive')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an unarchive button (list).
$bar->appendButton('Standard', 'unarchive', $alt, $task, true);
}
@@ -310,7 +309,7 @@ public static function unarchiveList($task = 'unarchive', $alt = 'Unarchive')
*/
public static function editList($task = 'edit', $alt = 'Edit')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an edit button.
$bar->appendButton('Standard', 'edit', $alt, $task, true);
}
@@ -338,7 +337,7 @@ public static function editListX($task = 'edit', $alt = 'Edit')
*/
public static function editHtml($task = 'edit_source', $alt = 'EDIT_HTML')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an edit html button.
$bar->appendButton('Standard', 'edithtml', $alt, $task, true);
}
@@ -366,7 +365,7 @@ public static function editHtmlX($task = 'edit_source', $alt = 'EDIT_HTML')
*/
public static function editCss($task = 'edit_css', $alt = 'EDIT_CSS')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an edit css button (hide).
$bar->appendButton('Standard', 'editcss', $alt, $task, true);
}
@@ -395,7 +394,7 @@ public static function editCssX($task = 'edit_css', $alt = 'EDIT_CSS')
*/
public static function deleteList($msg = '', $task = 'remove', $alt = 'Delete')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a delete button.
if ($msg) {
$bar->appendButton('Confirm', $msg, 'delete', $alt, $task, true);
@@ -429,7 +428,7 @@ public static function deleteListX($msg = '', $task = 'remove', $alt = 'Delete')
*/
public static function trash($task = 'remove', $alt = 'Trash', $check = true)
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a trash button.
$bar->appendButton('Standard', 'trash', $alt, $task, $check, false);
}
@@ -444,7 +443,7 @@ public static function trash($task = 'remove', $alt = 'Trash', $check = true)
*/
public static function apply($task = 'apply', $alt = 'Apply')
{
- $bar = & JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add an apply button
$bar->appendButton('Standard', 'apply', $alt, $task, false);
}
@@ -459,7 +458,7 @@ public static function apply($task = 'apply', $alt = 'Apply')
*/
public static function save($task = 'save', $alt = 'Save')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a save button.
$bar->appendButton('Standard', 'save', $alt, $task, false);
}
@@ -473,7 +472,7 @@ public static function save($task = 'save', $alt = 'Save')
*/
public static function cancel($task = 'cancel', $alt = 'Cancel')
{
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a cancel button.
$bar->appendButton('Standard', 'cancel', $alt, $task, false);
}
@@ -494,7 +493,7 @@ public static function preferences($component, $height = '450', $width = '800',
$path = urlencode($path);
$top = 0;
$left = 0;
- $bar = &JToolBar::getInstance('toolbar');
+ $bar = JToolBar::getInstance('toolbar');
// Add a configuration button.
$bar->appendButton('Popup', 'config', $alt, 'index.php?option=com_config&amp;view=component&amp;component='.$component.'&amp;path='.$path.'&amp;tmpl=component', $width, $height, $top, $left, $onClose);
}
@@ -516,7 +515,7 @@ public static function preferences($component, $height = '450', $width = '800',
*/
public static function addEntry($name, $link = '', $active = false)
{
- $menu = &JToolBar::getInstance('submenu');
+ $menu = JToolBar::getInstance('submenu');
$menu->appendButton($name, $link, $active);
}
}
View
@@ -18,7 +18,7 @@
JDEBUG ? $_PROFILER->mark('afterLoad') : null;
// Instantiate the application.
-$app = &JFactory::getApplication('site');
+$app = JFactory::getApplication('site');
// Initialise the application.
$app->initialise();
View
@@ -30,6 +30,7 @@ $ -> Language fix or change
23-Jun-2010 Andrew Eddie
# Fixed issue [#21146] Fix for broken JFormFieldCalendarTest.
+ # Fixed issue [#20907] Making Joomla more compliant to PHP strict standard (Hannes Papenberg, Phil Snell).
23-Jun-2010 Jean-Marie Simonet
$ Added missing string
@@ -22,29 +22,31 @@ class JInstallationController extends JController
/**
* Method to display a view.
*
- * @return void
- * @since 1.0
+ * @param boolean If true, the view output will be cached
+ * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
+ *
+ * @return JController This object to support chaining.
+ * @since 1.5
*/
- public function display()
+ public function display($cachable = false, $urlparams = false)
{
// Get the current URI to redirect to.
- $uri = &JURI::getInstance();
+ $uri = JURI::getInstance();
$redirect = base64_encode($uri);
// Get the document object.
- $document = &JFactory::getDocument();
+ $document = JFactory::getDocument();
// Set the default view name and format from the Request.
$vName = JRequest::getWord('view', 'language');
$vFormat = $document->getType();
$lName = JRequest::getWord('layout', 'default');
- if ($view = &$this->getView($vName, $vFormat))
- {
- switch ($vName)
- {
+ if ($view = $this->getView($vName, $vFormat)) {
+
+ switch ($vName) {
default:
- $model = &$this->getModel('Setup', 'JInstallationModel', array('dbo' => null));
+ $model = $this->getModel('Setup', 'JInstallationModel', array('dbo' => null));
break;
}
@@ -57,5 +59,7 @@ public function display()
$view->display();
}
+
+ return $this;
}
}
Oops, something went wrong.

0 comments on commit 38c5d38

Please sign in to comment.