Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove more deprecated code.

  • Loading branch information...
commit f83e1675060c0ef67d2ebc2989437d3fc641f03f 1 parent 5d59eb0
@realityking realityking authored
View
4 libraries/joomla/application/component/controlleradmin.php
@@ -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');
View
22 libraries/joomla/environment/request.php
@@ -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);
}
/**
View
16 libraries/joomla/html/html.php
@@ -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
View
10 libraries/joomla/html/html/list.php
@@ -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');
View
18 libraries/joomla/language/language.php
@@ -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()
{
View
17 libraries/joomla/utilities/date.php
@@ -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.
View
110 media/system/js/core-uncompressed.js
@@ -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
20 media/system/js/core.js
@@ -1,15 +1,13 @@
/*
GNU General Public License version 2 or later; see LICENSE.txt
*/
-if(typeof Joomla==="undefined")var Joomla={};Joomla.editors={};Joomla.editors.instances={};Joomla.submitform=function(a,b){if(typeof b==="undefined"&&(b=document.getElementById("adminForm"),!b))b=document.adminForm;if(typeof a!=="undefined")b.task.value=a;if(typeof b.onsubmit=="function")b.onsubmit();typeof b.fireEvent=="function"&&b.fireEvent("submit");b.submit()};Joomla.submitbutton=function(a){Joomla.submitform(a)};
-Joomla.JText={strings:{},_:function(a,b){return typeof this.strings[a.toUpperCase()]!=="undefined"?this.strings[a.toUpperCase()]:b},load:function(a){for(var b in a)this.strings[b.toUpperCase()]=a[b];return this}};Joomla.replaceTokens=function(a){for(var b=document.getElementsByTagName("input"),c=0;c<b.length;c++)if(b[c].type=="hidden"&&b[c].name.length==32&&b[c].value=="1")b[c].name=a};Joomla.isEmail=function(a){return/^[\w-_.]*[\w-_.]@[\w].+[\w]+[\w]$/.test(a)};
-Joomla.checkAll=function(a,b){b||(b="cb");if(a.form){for(var c=0,d=0,f=a.form.elements.length;d<f;d++){var e=a.form.elements[d];if(e.type==a.type&&(b&&e.id.indexOf(b)==0||!b))e.checked=a.checked,c+=e.checked==!0?1:0}if(a.form.boxchecked)a.form.boxchecked.value=c;return!0}return!1};
+if("undefined"===typeof Joomla)var Joomla={};Joomla.editors={};Joomla.editors.instances={};Joomla.submitform=function(a,b){"undefined"===typeof b&&(b=document.getElementById("adminForm"));"undefined"!==typeof a&&(b.task.value=a);if("function"==typeof b.onsubmit)b.onsubmit();"function"==typeof b.fireEvent&&b.fireEvent("submit");b.submit()};Joomla.submitbutton=function(a){Joomla.submitform(a)};
+Joomla.JText={strings:{},_:function(a,b){return"undefined"!==typeof this.strings[a.toUpperCase()]?this.strings[a.toUpperCase()]:b},load:function(a){for(var b in a)this.strings[b.toUpperCase()]=a[b];return this}};Joomla.replaceTokens=function(a){for(var b=document.getElementsByTagName("input"),c=0;c<b.length;c++)"hidden"==b[c].type&&32==b[c].name.length&&"1"==b[c].value&&(b[c].name=a)};Joomla.isEmail=function(a){return/^[\w-_.]*[\w-_.]@[\w].+[\w]+[\w]$/.test(a)};
+Joomla.checkAll=function(a,b){b||(b="cb");if(a.form){for(var c=0,d=0,f=a.form.elements.length;d<f;d++){var e=a.form.elements[d];if(e.type==a.type&&(b&&0==e.id.indexOf(b)||!b))e.checked=a.checked,c+=!0==e.checked?1:0}a.form.boxchecked&&(a.form.boxchecked.value=c);return!0}return!1};
Joomla.renderMessages=function(a){Joomla.removeMessages();var b=document.id("system-message-container"),c=new Element("dl",{id:"system-message",role:"alert"});Object.each(a,function(a,b){(new Element("dt",{"class":b,html:b})).inject(c);var e=new Element("dd",{"class":b});e.addClass("message");var g=new Element("ul");Array.each(a,function(a){(new Element("li",{html:a})).inject(g)},this);g.inject(e);e.inject(c)},this);c.inject(b)};Joomla.removeMessages=function(){$$("#system-message-container > *").destroy()};
-Joomla.isChecked=function(a,b){typeof b==="undefined"&&(b=document.getElementById("adminForm"));a==!0?b.boxchecked.value++:b.boxchecked.value--};Joomla.popupWindow=function(a,b,c,d,f){window.open(a,b,"height="+d+",width="+c+",top="+(screen.height-d)/2+",left="+(screen.width-c)/2+",scrollbars="+f+",resizable").window.focus()};
-Joomla.tableOrdering=function(a,b,c,d){typeof d==="undefined"&&(d=document.getElementById("adminForm"));d.filter_order.value=a;d.filter_order_Dir.value=b;Joomla.submitform(c,d)};function writeDynaList(a,b,c,d,f){var a="\n\t<select "+a+">",e=0;for(x in b){if(b[x][0]==c){var g="";if(d==c&&f==b[x][1]||e==0&&d!=c)g='selected="selected"';a+='\n\t\t<option value="'+b[x][1]+'" '+g+">"+b[x][2]+"</option>"}e++}a+="\n\t</select>";document.writeln(a)}
-function changeDynaList(a,b,c,d,f){a=document.adminForm[a];for(i in a.options.length)a.options[i]=null;i=0;for(x in b)if(b[x][0]==c){opt=new Option;opt.value=b[x][1];opt.text=b[x][2];if(d==c&&f==opt.value||i==0)opt.selected=!0;a.options[i++]=opt}a.length=i}function radioGetCheckedValue(a){if(!a)return"";var b=a.length;if(b==void 0)return a.checked?a.value:"";for(var c=0;c<b;c++)if(a[c].checked)return a[c].value;return""}
-function getSelectedValue(a,b){var c=document[a][b];i=c.selectedIndex;return i!=null&&i>-1?c.options[i].value:null}
-function checkAll(a,b){b||(b="cb");if(a.form){for(var c=0,d=0,f=a.form.elements.length;d<f;d++){var e=a.form.elements[d];if(e.type==a.type&&(b&&e.id.indexOf(b)==0||!b))e.checked=a.checked,c+=e.checked==!0?1:0}if(a.form.boxchecked)a.form.boxchecked.value=c;return!0}else{for(var e=document.adminForm,c=e.toggle.checked,f=a,g=0,d=0;d<f;d++){var h=e[b+""+d];if(h)h.checked=c,g++}document.adminForm.boxchecked.value=c?g:0}}
-function listItemTask(a,b){var c=document.adminForm,d=c[a];if(d){for(var f=0;;f++){var e=c["cb"+f];if(!e)break;e.checked=!1}d.checked=!0;c.boxchecked.value=1;submitbutton(b)}return!1}function isChecked(a){a==!0?document.adminForm.boxchecked.value++:document.adminForm.boxchecked.value--}function submitbutton(a){submitform(a)}
-function submitform(a){if(a)document.adminForm.task.value=a;if(typeof document.adminForm.onsubmit=="function")document.adminForm.onsubmit();typeof document.adminForm.fireEvent=="function"&&document.adminForm.fireEvent("submit");document.adminForm.submit()}function popupWindow(a,b,c,d,f){winprops="height="+d+",width="+c+",top="+(screen.height-d)/2+",left="+(screen.width-c)/2+",scrollbars="+f+",resizable";win=window.open(a,b,winprops);parseInt(navigator.appVersion)>=4&&win.window.focus()}
-function tableOrdering(a,b,c){var d=document.adminForm;d.filter_order.value=a;d.filter_order_Dir.value=b;submitform(c)}function saveorder(a,b){checkAll_button(a,b)}function checkAll_button(a,b){b||(b="saveorder");for(var c=0;c<=a;c++){var d=document.adminForm["cb"+c];if(d){if(d.checked==!1)d.checked=!0}else{alert("You cannot change the order of items, as an item in the list is `Checked Out`");return}}submitform(b)};
+Joomla.isChecked=function(a,b){"undefined"===typeof b&&(b=document.getElementById("adminForm"));!0==a?b.boxchecked.value++:b.boxchecked.value--};Joomla.popupWindow=function(a,b,c,d,f){window.open(a,b,"height="+d+",width="+c+",top="+(screen.height-d)/2+",left="+(screen.width-c)/2+",scrollbars="+f+",resizable").window.focus()};
+Joomla.tableOrdering=function(a,b,c,d){"undefined"===typeof d&&(d=document.getElementById("adminForm"));d.filter_order.value=a;d.filter_order_Dir.value=b;Joomla.submitform(c,d)};function writeDynaList(a,b,c,d,f){var a="\n\t<select "+a+">",e=0;for(x in b){if(b[x][0]==c){var g="";if(d==c&&f==b[x][1]||0==e&&d!=c)g='selected="selected"';a+='\n\t\t<option value="'+b[x][1]+'" '+g+">"+b[x][2]+"</option>"}e++}document.writeln(a+"\n\t</select>")}
+function changeDynaList(a,b,c,d,f){a=document.adminForm[a];for(i in a.options.length)a.options[i]=null;i=0;for(x in b)if(b[x][0]==c){opt=new Option;opt.value=b[x][1];opt.text=b[x][2];if(d==c&&f==opt.value||0==i)opt.selected=!0;a.options[i++]=opt}a.length=i}function radioGetCheckedValue(a){if(!a)return"";var b=a.length;if(void 0==b)return a.checked?a.value:"";for(var c=0;c<b;c++)if(a[c].checked)return a[c].value;return""}
+function getSelectedValue(a,b){var c=document[a][b];i=c.selectedIndex;return null!=i&&-1<i?c.options[i].value:null}function listItemTask(a,b){var c=document.adminForm,d=c[a];if(d){for(var f=0;;f++){var e=c["cb"+f];if(!e)break;e.checked=!1}d.checked=!0;c.boxchecked.value=1;submitbutton(b)}return!1}function submitbutton(a){submitform(a)}
+function submitform(a){a&&(document.adminForm.task.value=a);if("function"==typeof document.adminForm.onsubmit)document.adminForm.onsubmit();"function"==typeof document.adminForm.fireEvent&&document.adminForm.fireEvent("submit");document.adminForm.submit()}function saveorder(a,b){checkAll_button(a,b)}
+function checkAll_button(a,b){b||(b="saveorder");for(var c=0;c<=a;c++){var d=document.adminForm["cb"+c];if(d)!1==d.checked&&(d.checked=!0);else{alert("You cannot change the order of items, as an item in the list is `Checked Out`");return}}submitform(b)};
View
13 tests/suite/joomla/html/JHtmlTest.php
@@ -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
View
30 tests/suite/joomla/utilities/JDateTest.php
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.