Permalink
Browse files

Remove more deprecated code.

  • Loading branch information...
1 parent 5d59eb0 commit f83e1675060c0ef67d2ebc2989437d3fc641f03f @realityking realityking committed Feb 19, 2012
@@ -109,7 +109,7 @@ public function __construct($config = array())
public function delete()
{
// Check for request forgeries
- JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));
+ JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// Get items to remove from the request.
$cid = JRequest::getVar('cid', array(), '', 'array');
@@ -166,7 +166,7 @@ public function display($cachable = false, $urlparams = array())
public function publish()
{
// Check for request forgeries
- JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));
+ JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// Get items to publish from the request.
$cid = JRequest::getVar('cid', array(), '', 'array');
@@ -509,27 +509,7 @@ public static function set($array, $hash = 'default', $overwrite = true)
*/
public static function checkToken($method = 'post')
{
- $token = JSession::getFormToken();
- if (!self::getVar($token, '', $method, 'alnum'))
- {
- $session = JFactory::getSession();
- if ($session->isNew())
- {
- // Redirect to login screen.
- $app = JFactory::getApplication();
- $return = JRoute::_('index.php');
- $app->redirect($return, JText::_('JLIB_ENVIRONMENT_SESSION_EXPIRED'));
- $app->close();
- }
- else
- {
- return false;
- }
- }
- else
- {
- return true;
- }
+ return JSession::checkToken($method);
}
/**
@@ -602,22 +602,6 @@ public static function script($file, $framework = false, $relative = false, $pat
}
/**
- * Add the /media/system/js/core Javascript file.
- *
- * @param boolean $debug True if debugging is enabled.
- *
- * @return void
- *
- * @since 11.1
- * @deprecated 12.1 Use JHtml::_('behavior.framework'); instead.
- */
- public static function core($debug = null)
- {
- JLog::add('JHtml::core() is deprecated. Use JHtml::_(\'behavior.framework\');.', JLog::WARNING, 'deprecated');
- JHtml::_('behavior.framework', false, $debug);
- }
-
- /**
* Set format related options.
*
* Updates the formatOptions array with all valid values in the passed
@@ -170,24 +170,16 @@ public static function ordering($name, $query, $attribs = null, $selected = null
* @param integer $nouser If set include an option to select no user
* @param string $javascript Custom javascript
* @param string $order Specify a field to order by
- * @param string $reg Deprecated Excludes users who are explicitly in group 2.
*
* @return string The HTML for a list of users list of users
*
* @since 11.1
*/
- public static function users($name, $active, $nouser = 0, $javascript = null, $order = 'name', $reg = 1)
+ public static function users($name, $active, $nouser = 0, $javascript = null, $order = 'name')
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
- if ($reg)
- {
- // Does not include registered users in the list
- // @deprecated
- $query->where('m.group_id != 2');
- }
-
$query->select('u.id AS value, u.name AS text');
$query->from('#__users AS u');
$query->join('LEFT', '#__user_usergroup_map AS m ON m.user_id = u.id');
@@ -428,24 +428,6 @@ public function getPluralSuffixes($count)
* @return mixed Function name (string) or the actual function for PHP 5.3 (function).
*
* @since 11.1
- *
- * @deprecated 12.1
- * @note Use JLanguage::getPluralSuffixesCallback method instead
- */
- public function getPluralSufficesCallback()
- {
- // Deprecation warning.
- JLog::add('JLanguage::_getPluralSufficesCallback() is deprecated.', JLog::WARNING, 'deprecated');
-
- return $this->getPluralSuffixesCallback();
- }
-
- /**
- * Getter for pluralSuffixesCallback function.
- *
- * @return mixed Function name (string) or the actual function for PHP 5.3 (function).
- *
- * @since 11.1
*/
public function getPluralSuffixesCallback()
{
@@ -404,23 +404,6 @@ public function toISO8601($local = false)
}
/**
- * Gets the date as an MySQL datetime string.
- *
- * @param boolean $local True to return the date string in the local time zone, false to return it in GMT.
- *
- * @return string The date string in MySQL datetime format.
- *
- * @link http://dev.mysql.com/doc/refman/5.0/en/datetime.html
- * @since 11.1
- * @deprecated 12.1 Use JDate::toSql()
- */
- public function toMySQL($local = false)
- {
- JLog::add('JDate::toMySQL() is deprecated. Use JDate::toSql() instead.', JLog::WARNING, 'deprecated');
- return $this->format('Y-m-d H:i:s', $local, false);
- }
-
- /**
* Gets the date as an SQL datetime string.
*
* @param boolean $local True to return the date string in the local time zone, false to return it in GMT.
@@ -18,12 +18,6 @@ Joomla.editors.instances = {};
Joomla.submitform = function(task, form) {
if (typeof(form) === 'undefined') {
form = document.getElementById('adminForm');
- /**
- * Added to ensure Joomla 1.5 compatibility
- */
- if(!form){
- form = document.adminForm;
- }
}
if (typeof(task) !== 'undefined') {
@@ -356,58 +350,6 @@ function getSelectedValue(frmName, srcListName) {
}
/**
- * USED IN: all list forms.
- *
- * Toggles the check state of a group of boxes
- *
- * Checkboxes must have an id attribute in the form cb0, cb1...
- *
- * @param mixed The number of box to 'check', for a checkbox element
- * @param string An alternative field name
- *
- * @deprecated 12.1 This function will be removed in a future version. Use Joomla.checkAll() instead.
- */
-function checkAll(checkbox, stub) {
- if (!stub) {
- stub = 'cb';
- }
- if (checkbox.form) {
- var c = 0;
- for (var i = 0, n = checkbox.form.elements.length; i < n; i++) {
- var e = checkbox.form.elements[i];
- if (e.type == checkbox.type) {
- if ((stub && e.id.indexOf(stub) == 0) || !stub) {
- e.checked = checkbox.checked;
- c += (e.checked == true ? 1 : 0);
- }
- }
- }
- if (checkbox.form.boxchecked) {
- checkbox.form.boxchecked.value = c;
- }
- return true;
- } else {
- // The old way of doing it
- var f = document.adminForm;
- var c = f.toggle.checked;
- var n = checkbox;
- var n2 = 0;
- for (var i = 0; i < n; i++) {
- var cb = f[stub+''+i];
- if (cb) {
- cb.checked = c;
- n2++;
- }
- }
- if (c) {
- document.adminForm.boxchecked.value = n2;
- } else {
- document.adminForm.boxchecked.value = 0;
- }
- }
-}
-
-/**
* USED IN: all over :)
*
* @param id
@@ -432,27 +374,6 @@ function listItemTask(id, task) {
}
/**
- * USED IN: administrator/components/com_cache/views/cache/tmpl/default.php
- * administrator/components/com_installer/views/discover/tmpl/default_item.php
- * administrator/components/com_installer/views/update/tmpl/default_item.php
- * administrator/components/com_languages/helpers/html/languages.php
- * libraries/joomla/html/html/grid.php
- *
- * @deprecated 12.1 This function will be removed in a future version. Use Joomla.isChecked() instead.
- *
- * @param isitchecked
- * @return
- *
- */
-function isChecked(isitchecked) {
- if (isitchecked == true) {
- document.adminForm.boxchecked.value++;
- } else {
- document.adminForm.boxchecked.value--;
- }
-}
-
-/**
* Default function. Usually would be overriden by the component
*
* @deprecated 12.1 This function will be removed in a future version. Use Joomla.submitbutton() instead.
@@ -479,40 +400,9 @@ function submitform(pressbutton) {
document.adminForm.submit();
}
-/**
- * USED IN: libraries/joomla/html/toolbar/button/help.php
- *
- * Pops up a new window in the middle of the screen
- *
- * @deprecated 12.1 This function will be removed in a future version. Use Joomla.popupWindow() instead.
- */
-function popupWindow(mypage, myname, w, h, scroll) {
- var winl = (screen.width - w) / 2;
- var wint = (screen.height - h) / 2;
- winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl
- + ',scrollbars=' + scroll + ',resizable'
- win = window.open(mypage, myname, winprops)
- if (parseInt(navigator.appVersion) >= 4) {
- win.window.focus();
- }
-}
-
// needed for Table Column ordering
/**
* USED IN: libraries/joomla/html/html/grid.php
- *
- * @deprecated 12.1 This function will be removed in a future version. Use Joomla.tableOrdering() instead.
- */
-function tableOrdering(order, dir, task) {
- var form = document.adminForm;
-
- form.filter_order.value = order;
- form.filter_order_Dir.value = dir;
- submitform(task);
-}
-
-/**
- * USED IN: libraries/joomla/html/html/grid.php
*/
function saveorder(n, task) {
checkAll_button(n, task);
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -202,19 +202,6 @@ public function testIsRegistered()
}
/**
- * @todo Implement testCore().
- *
- * @return void
- */
- public function testCore()
- {
- // Remove the following lines when you implement this test.
- $this->markTestIncomplete(
- 'This test has not been implemented yet.'
- );
- }
-
- /**
* Gets the data for testing the JHtml::link method.
*
* @return array
@@ -719,36 +719,6 @@ public function testToISO8601($tz, $setTime, $local, $expected)
}
/**
- * Testing toMySQL
- *
- * @param mixed $tz Which time zone? (can be string or numeric
- * @param string $setTime What time should be set?
- * @param boolean $local Local (true) or GMT?
- * @param string $expected What should the resulting time string look like?
- *
- * @return void
- *
- * @dataProvider casesToMySQL
- * @since 11.3
- */
- public function testToMySQL($tz, $setTime, $local, $expected)
- {
- if (is_null($tz))
- {
- $testJDate = new JDate($setTime);
- }
- else
- {
- $testJDate = new JDate($setTime, $tz);
- }
-
- $this->assertThat(
- $testJDate->toMySQL($local),
- $this->equalTo($expected)
- );
- }
-
- /**
* Testing toSql
*
* @param mixed $tz Which time zone? (can be string or numeric

0 comments on commit f83e167

Please sign in to comment.