Issue 3873

Replace deprecated functions with new syntax
This commit is contained in:
Adam Magness 2017-11-06 18:55:24 -05:00
parent 72474dc2f6
commit 48dcbc6f3f
61 changed files with 1036 additions and 920 deletions

View file

@ -49,6 +49,7 @@
* THE SOFTWARE.
*/
use Friendica\Core\Config;
function blackout_install() {
register_hook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect');
@ -67,9 +68,9 @@ function blackout_redirect ($a, $b) {
return true;
// else...
$mystart = get_config('blackout','begindate');
$myend = get_config('blackout','enddate');
$myurl = get_config('blackout','url');
$mystart = Config::get('blackout','begindate');
$myend = Config::get('blackout','enddate');
$myurl = Config::get('blackout','url');
$now = time();
$date1 = DateTime::createFromFormat('Y-m-d G:i', $mystart);
$date2 = DateTime::createFromFormat('Y-m-d G:i', $myend);
@ -87,11 +88,11 @@ function blackout_redirect ($a, $b) {
}
function blackout_plugin_admin(&$a, &$o) {
$mystart = get_config('blackout','begindate');
$mystart = Config::get('blackout','begindate');
if (! is_string($mystart)) { $mystart = "YYYY-MM-DD:hhmm"; }
$myend = get_config('blackout','enddate');
$myend = Config::get('blackout','enddate');
if (! is_string($myend)) { $myend = "YYYY-MM-DD:hhmm"; }
$myurl = get_config('blackout','url');
$myurl = Config::get('blackout','url');
if (! is_string($myurl)) { $myurl = "http://www.example.com"; }
$t = get_markup_template( "admin.tpl", "addon/blackout/" );
@ -114,7 +115,7 @@ function blackout_plugin_admin_post (&$a) {
$begindate = trim($_POST['startdate']);
$enddate = trim($_POST['enddate']);
$url = trim($_POST['rurl']);
set_config('blackout','begindate',$begindate);
set_config('blackout','enddate',$enddate);
set_config('blackout','url',$url);
Config::set('blackout','begindate',$begindate);
Config::set('blackout','enddate',$enddate);
Config::set('blackout','url',$url);
}