diff --git a/_init.php b/_init.php deleted file mode 100644 index b9df621..0000000 --- a/_init.php +++ /dev/null @@ -1,20 +0,0 @@ -addBehavior($behavior, $function); + App::behavior()->addBehavior($behavior, $function); } } } diff --git a/src/ActivityBehaviors.php b/src/ActivityBehaviors.php index c541a7e..762edff 100644 --- a/src/ActivityBehaviors.php +++ b/src/ActivityBehaviors.php @@ -1,23 +1,12 @@ add(new Action( 'preference', __('updating user preference'), __('"%s" user preference has been updated'), 'adminAfterUserOptionsUpdate', - [self::class, 'userPreference'] + self::userPreference(...) )); $user->add(new Action( 'preference', __('updating user preference'), __('"%s" user preference has been updated'), 'adminAfterDashboardOptionsUpdate', - [self::class, 'userOption'] + self::userOption(...) )); // from BEHAVIOR adminBeforeUserDelete in admin/users.php @@ -219,7 +216,7 @@ class ActivityBehaviors __('user deletion'), __('User named "%s" has been deleted by "%"'), 'adminBeforeUserDelete', - [self::class, 'userDelete'] + self::userDelete(...) )); ActivityReport::instance()->groups @@ -274,26 +271,26 @@ class ActivityBehaviors public static function blogUpdate(Cursor $cur, string $blog_id): void { - $logs = [self::str(dcCore::app()->auth->getInfo('user_cn'))]; + $logs = [self::str(App::auth()->getInfo('user_cn'))]; ActivityReport::instance()->addLog('blog', 'update', $logs); } public static function blogP404(): void { - if (dcCore::app()->url->type != '404') { + if (App::url()->type != '404') { return; } - $logs = [self::str(dcCore::app()->blog?->url) . $_SERVER['QUERY_STRING']]; + $logs = [self::str(App::blog()->url()) . $_SERVER['QUERY_STRING']]; ActivityReport::instance()->addLog('blog', 'p404', $logs); } public static function postCreate(Cursor $cur, int $post_id): void { - $post_url = dcCore::app()->blog?->getPostURL('', self::str($cur->getField('post_dt')), self::str($cur->getField('post_title')), $post_id); + $post_url = App::blog()->getPostURL('', self::str($cur->getField('post_dt')), self::str($cur->getField('post_title')), $post_id); $logs = [ self::str($cur->getField('post_title')), - self::str(dcCore::app()->auth->getInfo('user_cn')), - self::str(dcCore::app()->blog?->url) . dcCore::app()->url->getBase(self::str($cur->getField('post_type'))) . '/' . $post_url, + self::str(App::auth()->getInfo('user_cn')), + self::str(App::blog()->url()) . App::url()->getBase(self::str($cur->getField('post_type'))) . '/' . $post_url, ]; ActivityReport::instance()->addLog('post', 'create', $logs); } @@ -301,24 +298,24 @@ class ActivityBehaviors public static function postUpdate(Cursor $cur, int|string $post_id): void { $post_id = is_numeric($post_id) ? (int) $post_id : 0; - $post_url = dcCore::app()->blog?->getPostURL('', self::str($cur->getField('post_dt')), self::str($cur->getField('post_title')), $post_id); + $post_url = App::blog()->getPostURL('', self::str($cur->getField('post_dt')), self::str($cur->getField('post_title')), $post_id); $logs = [ self::str($cur->getField('post_title')), - self::str(dcCore::app()->auth->getInfo('user_cn')), - self::str(dcCore::app()->blog?->url) . dcCore::app()->url->getBase(self::str($cur->getField('post_type'))) . '/' . $post_url, + self::str(App::auth()->getInfo('user_cn')), + self::str(App::blog()->url()) . App::url()->getBase(self::str($cur->getField('post_type'))) . '/' . $post_url, ]; ActivityReport::instance()->addLog('post', 'update', $logs); } public static function postDelete(int $post_id): void { - $posts = dcCore::app()->blog?->getPosts(['post_id' => $post_id, 'limit' => 1]); + $posts = App::blog()->getPosts(['post_id' => $post_id, 'limit' => 1]); if (!$posts || $posts->isEmpty()) { return; } $logs = [ self::str($posts->f('post_title')), - self::str(dcCore::app()->auth->getInfo('user_cn')), + self::str(App::auth()->getInfo('user_cn')), ]; ActivityReport::instance()->addLog('post', 'delete', $logs); } @@ -335,12 +332,12 @@ class ActivityBehaviors ActivityReport::instance()->addLog('post', 'protection', $logs); } - public static function commentCreate(dcBlog $blog, Cursor $cur): void + public static function commentCreate(BlogInterace $blog, Cursor $cur): void { if ($cur->getField('comment_trackback')) { return; } - $posts = dcCore::app()->blog?->getPosts( + $posts = App::blog()->getPosts( ['post_id' => $cur->getField('post_id'), 'limit' => 1, 'post_type' => ''] ); if (!$posts || $posts->isEmpty()) { @@ -350,15 +347,15 @@ class ActivityBehaviors $logs = [ self::str($cur->getField('comment_author')), self::str($posts->f('post_title')), - self::str(dcCore::app()->blog?->url) . dcCore::app()->url->getBase(self::str($posts->f('post_type'))) . + self::str(App::blog()->url()) . App::url()->getBase(self::str($posts->f('post_type'))) . '/' . self::str($posts->f('post_url')) . '#c' . self::str($cur->getField('comment_id')), ]; ActivityReport::instance()->addLog('comment', 'create', $logs); } - public static function commentUpdate(dcBlog $blog, Cursor $cur, MetaRecord $old): void + public static function commentUpdate(BlogInterace $blog, Cursor $cur, MetaRecord $old): void { - $posts = dcCore::app()->blog?->getPosts( + $posts = App::blog()->getPosts( ['post_id' => $old->f('post_id'), 'limit' => 1] ); if (!$posts || $posts->isEmpty()) { @@ -366,21 +363,21 @@ class ActivityBehaviors } $logs = [ - self::str(dcCore::app()->auth->getInfo('user_cn')), + self::str(App::auth()->getInfo('user_cn')), self::str($posts->f('post_title')), - self::str(dcCore::app()->blog?->url) . dcCore::app()->url->getBase(self::str($posts->f('post_type'))) . + self::str(App::blog()->url()) . App::url()->getBase(self::str($posts->f('post_type'))) . '/' . self::str($posts->f('post_url')) . '#c' . self::str($old->f('comment_id')), ]; ActivityReport::instance()->addLog('comment', 'update', $logs); } - public static function trackbackCreate(dcBlog $blog, Cursor $cur): void + public static function trackbackCreate(BlogInterace $blog, Cursor $cur): void { if (!$cur->getField('comment_trackback')) { return; } - $posts = dcCore::app()->blog?->getPosts( + $posts = App::blog()->getPosts( ['post_id' => $cur->getField('post_id'), 'no_content' => true, 'limit' => 1] ); if (!$posts || $posts->isEmpty()) { @@ -391,7 +388,7 @@ class ActivityBehaviors self::str($cur->getField('comment_author')), self::str($cur->getField('comment_site')), self::str($posts->f('post_title')), - self::str(dcCore::app()->blog?->url) . dcCore::app()->url->getBase(self::str($posts->f('post_type'))) . + self::str(App::blog()->url()) . App::url()->getBase(self::str($posts->f('post_type'))) . '/' . self::str($posts->f('post_url')), ]; ActivityReport::instance()->addLog('comment', 'trackback', $logs); @@ -401,8 +398,8 @@ class ActivityBehaviors { $logs = [ self::str($cur->getField('cat_title')), - self::str(dcCore::app()->auth->getInfo('user_cn')), - self::str(dcCore::app()->blog?->url) . dcCore::app()->url->getBase('category') . '/' . self::str($cur->getField('cat_url')), + self::str(App::auth()->getInfo('user_cn')), + self::str(App::blog()->url()) . App::url()->getBase('category') . '/' . self::str($cur->getField('cat_url')), ]; ActivityReport::instance()->addLog('category', 'create', $logs); } @@ -411,8 +408,8 @@ class ActivityBehaviors { $logs = [ self::str($cur->getField('cat_title')), - self::str(dcCore::app()->auth->getInfo('user_cn')), - self::str(dcCore::app()->blog?->url) . dcCore::app()->url->getBase('category') . '/' . self::str($cur->getField('cat_url')), + self::str(App::auth()->getInfo('user_cn')), + self::str(App::blog()->url()) . App::url()->getBase('category') . '/' . self::str($cur->getField('cat_url')), ]; ActivityReport::instance()->addLog('category', 'update', $logs); } @@ -427,7 +424,7 @@ class ActivityBehaviors ); $logs = [ self::str($user_cn), - self::str(dcCore::app()->auth->getInfo('user_cn')), + self::str(App::auth()->getInfo('user_cn')), ]; ActivityReport::instance()->addLog('user', 'create', $logs); } @@ -442,7 +439,7 @@ class ActivityBehaviors ); $logs = [ self::str($user_cn), - self::str(dcCore::app()->auth->getInfo('user_cn')), + self::str(App::auth()->getInfo('user_cn')), ]; ActivityReport::instance()->addLog('user', 'update', $logs); } @@ -454,11 +451,11 @@ class ActivityBehaviors public static function userOption(string $user_id): void { - $user = dcCore::app()->getUser($user_id); + $user = App::users()->getUser($user_id); if ($user->isEmpty()) { return; } - $user_cn = dcUtils::getUserCN( + $user_cn = App::users()->getUserCN( self::str($user->f('user_id')), self::str($user->f('user_name')), self::str($user->f('user_firstname')), @@ -472,8 +469,8 @@ class ActivityBehaviors public static function userDelete(string $user_id): void { - $users = dcCore::app()->getUser($user_id); - $user_cn = dcUtils::getUserCN( + $users = App::users()->getUser($user_id); + $user_cn = App::users()->getUserCN( self::str($users->f('user_id')), self::str($users->f('user_name')), self::str($users->f('user_firstname')), @@ -481,7 +478,7 @@ class ActivityBehaviors ); $logs = [ self::str($user_cn), - self::str(dcCore::app()->auth->getInfo('user_cn')), + self::str(App::auth()->getInfo('user_cn')), ]; ActivityReport::instance()->addLog('user', 'delete', $logs); } diff --git a/src/ActivityReport.php b/src/ActivityReport.php index 2fc79fc..d4fa778 100644 --- a/src/ActivityReport.php +++ b/src/ActivityReport.php @@ -1,23 +1,11 @@ from($sql->as(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME, 'E'), false, true) + ->from($sql->as(App::con()->prefix() . My::ACTIVITY_TABLE_NAME, 'E'), false, true) ->join( (new JoinStatement()) ->left() - ->from($sql->as(dcCore::app()->prefix . dcBlog::BLOG_TABLE_NAME, 'B')) + ->from($sql->as(App::con()->prefix() . App::blog()::BLOG_TABLE_NAME, 'B')) ->on('E.blog_id = B.blog_id') ->statement() ); @@ -169,7 +161,7 @@ class ActivityReport } $sql->and('E.blog_id' . $sql->in($params['blog_id'])); } else { - $sql->and('E.blog_id = ' . $sql->quote((string) dcCore::app()->blog?->id)); + $sql->and('E.blog_id = ' . $sql->quote(App::blog()->id())); } if (isset($params['activity_status']) && is_numeric($params['activity_status'])) { @@ -240,12 +232,12 @@ class ActivityReport public function addLog(string $group, string $action, array $logs): void { try { - $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME); - dcCore::app()->con->writeLock(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME); + $cur = App::con()->openCursor(App::con()->prefix() . My::ACTIVITY_TABLE_NAME); + App::con()->writeLock(App::con()->prefix() . My::ACTIVITY_TABLE_NAME); $cur->setField('activity_id', $this->getNextId()); $cur->setField('activity_type', $this->type); - $cur->setField('blog_id', (string) dcCore::app()->blog?->id); + $cur->setField('blog_id', App::blog()->id()); $cur->setField('activity_group', $group); $cur->setField('activity_action', $action); $cur->setField('activity_logs', json_encode($logs)); @@ -253,13 +245,13 @@ class ActivityReport $cur->setField('activity_status', self::STATUS_PENDING); $cur->insert(); - dcCore::app()->con->unlock(); + App::con()->unlock(); # --BEHAVIOR-- coreAfterCategoryCreate -- ActivityReport, cursor - dcCore::app()->callBehavior('activityReportAfteAddLog', $this, $cur); + App::behavior()->callBehavior('activityReportAfteAddLog', $this, $cur); } catch (Exception $e) { - dcCore::app()->con->unlock(); - dcCore::app()->error->add($e->getMessage()); + App::con()->unlock(); + App::error()->add($e->getMessage()); } // Test if email report is needed @@ -301,7 +293,7 @@ class ActivityReport $from = time(); $to = 0; $res = $blog_name = $blog_url = $group = ''; - $tz = dcCore::app()->blog?->settings->get('system')->get('blog_timezone'); + $tz = App::blog()->settings()->get('system')->get('blog_timezone'); $tz = is_string($tz) ? $tz : 'UTC'; $dt = empty($this->settings->dateformat) ? '%Y-%m-%d %H:%M:%S' : $this->settings->dateformat; $format = $this->formats->get($this->formats->has($this->settings->mailformat) ? $this->settings->mailformat : 'plain'); @@ -394,7 +386,7 @@ class ActivityReport { // Get blogs and logs count $sql = new SelectStatement(); - $sql->from(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME) + $sql->from(App::con()->prefix() . My::ACTIVITY_TABLE_NAME) ->column('blog_id') ->where('activity_type =' . $sql->quote($this->type)) ->group('blog_id'); @@ -410,16 +402,16 @@ class ActivityReport $obs = Date::str('%Y-%m-%d %H:%M:%S', $ts - (int) $this->settings->obsolete); if (is_string($rs->f('blog_id'))) { $sql = new DeleteStatement(); - $sql->from(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME) + $sql->from(App::con()->prefix() . My::ACTIVITY_TABLE_NAME) ->where('activity_type =' . $sql->quote($this->type)) ->and('activity_dt < TIMESTAMP ' . $sql->quote($obs)) ->and('blog_id = ' . $sql->quote($rs->f('blog_id'))) ->delete(); - if (dcCore::app()->con->changes()) { + if (App::con()->changes()) { try { - $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME); - dcCore::app()->con->writeLock(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME); + $cur = App::con()->openCursor(App::con()->prefix() . My::ACTIVITY_TABLE_NAME); + App::con()->writeLock(App::con()->prefix() . My::ACTIVITY_TABLE_NAME); $cur->setField('activity_id', $this->getNextId()); $cur->setField('activity_type', $this->type); @@ -431,10 +423,10 @@ class ActivityReport $cur->setField('activity_status', self::STATUS_PENDING); $cur->insert(); - dcCore::app()->con->unlock(); + App::con()->unlock(); } catch (Exception $e) { - dcCore::app()->con->unlock(); - dcCore::app()->error->add($e->getMessage()); + App::con()->unlock(); + App::error()->add($e->getMessage()); } } } @@ -456,7 +448,7 @@ class ActivityReport $sql->and('activity_status = ' . self::STATUS_REPORTED); } - return $sql->from(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME) + return $sql->from(App::con()->prefix() . My::ACTIVITY_TABLE_NAME) ->where('activity_type = ' . $sql->quote($this->type)) ->delete(); } @@ -470,10 +462,10 @@ class ActivityReport private function updateStatus(int $from_date_ts, int $to_date_ts): void { $sql = new UpdateStatement(); - $sql->from(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME) + $sql->from(App::con()->prefix() . My::ACTIVITY_TABLE_NAME) ->column('activity_status') ->set((string) self::STATUS_REPORTED) - ->where('blog_id = ' . $sql->quote((string) dcCore::app()->blog?->id)) + ->where('blog_id = ' . $sql->quote(App::blog()->id())) ->and('activity_type =' . $sql->quote($this->type)) ->and('activity_dt >= TIMESTAMP ' . $sql->quote(date('Y-m-d H:i:s', $from_date_ts))) ->and('activity_dt < TIMESTAMP ' . $sql->quote(date('Y-m-d H:i:s', $to_date_ts))) @@ -488,7 +480,7 @@ class ActivityReport public function getNextId(): int { $sql = new SelectStatement(); - $sql->from(dcCore::app()->prefix . My::ACTIVITY_TABLE_NAME) + $sql->from(App::con()->prefix() . My::ACTIVITY_TABLE_NAME) ->column($sql->max('activity_id')); return (int) $sql->select()?->f(0) + 1; @@ -503,14 +495,14 @@ class ActivityReport { try { # Cache writable ? - if (!is_writable(DC_TPL_CACHE)) { + if (!is_writable(App::config()->cacheRoot())) { throw new Exception("Can't write in cache fodler"); } # Set file path - $f_md5 = md5((string) dcCore::app()->blog?->id); + $f_md5 = md5(App::blog()->id()); $file = sprintf( '%s/%s/%s/%s/%s.txt', - DC_TPL_CACHE, + App::config()->cacheRoot(), My::id(), substr($f_md5, 0, 2), substr($f_md5, 2, 2), @@ -591,7 +583,7 @@ class ActivityReport $params = new ArrayObject([ 'from_date_ts' => $lastreport, 'to_date_ts' => $now, - 'blog_id' => dcCore::app()->blog?->id, + 'blog_id' => App::blog()->id(), 'activity_status' => self::STATUS_PENDING, 'requests' => true, 'order' => 'activity_group ASC, activity_action ASC, activity_dt ASC ', @@ -612,7 +604,7 @@ class ActivityReport $this->updateStatus($lastreport, $now); $this->settings->set('lastreport', $now); - dcCore::app()->callBehavior('messageActivityReport', 'Activity report has been successfully send by mail.'); + App::behavior()->callBehavior('messageActivityReport', 'Activity report has been successfully send by mail.'); } } @@ -658,20 +650,20 @@ class ActivityReport # Sending mails try { $subject = mb_encode_mimeheader( - sprintf(__('Blog "%s" activity report'), dcCore::app()->blog?->name), + sprintf(__('Blog "%s" activity report'), App::blog()->name()), 'UTF-8', 'B' ); $headers = []; - $headers[] = 'From: ' . (defined('DC_ADMIN_MAILFROM') && str_contains(DC_ADMIN_MAILFROM, '@') ? DC_ADMIN_MAILFROM : 'dotclear@local'); + $headers[] = 'From: ' . (defined('DC_ADMIN_MAILFROM') && str_contains(App::config()->adminMailFrom(), '@') ? App::config()->adminMailFrom() : 'dotclear@local'); $headers[] = 'Content-Type: text/' . $mailformat . '; charset=UTF-8;'; //$headers[] = 'MIME-Version: 1.0'; //$headers[] = 'X-Originating-IP: ' . mb_encode_mimeheader(Http::realIP(), 'UTF-8', 'B'); //$headers[] = 'X-Mailer: Dotclear'; - //$headers[] = 'X-Blog-Id: ' . mb_encode_mimeheader(dcCore::app()->blog->id), 'UTF-8', 'B'); - //$headers[] = 'X-Blog-Name: ' . mb_encode_mimeheader(dcCore::app()->blog->name), 'UTF-8', 'B'); - //$headers[] = 'X-Blog-Url: ' . mb_encode_mimeheader(dcCore::app()->blog->url), 'UTF-8', 'B'); + //$headers[] = 'X-Blog-Id: ' . mb_encode_mimeheader(App::blog()->id()), 'UTF-8', 'B'); + //$headers[] = 'X-Blog-Name: ' . mb_encode_mimeheader(App::blog()->name()), 'UTF-8', 'B'); + //$headers[] = 'X-Blog-Url: ' . mb_encode_mimeheader(App::>blog()->url()), 'UTF-8', 'B'); $done = true; foreach ($recipients as $email) { @@ -693,9 +685,9 @@ class ActivityReport */ public function getUserCode(): string { - $id = is_string(dcCore::app()->auth->userID()) ? dcCore::app()->auth->userID() : ''; - $pw = is_string(dcCore::app()->auth->getInfo('user_pwd')) ? dcCore::app()->auth->getInfo('user_pwd') : ''; - $code = pack('a32', $id) . pack('H*', Crypt::hmac(DC_MASTER_KEY, $pw)); + $id = is_string(App::auth()->userID()) ? App::auth()->userID() : ''; + $pw = is_string(App::auth()->getInfo('user_pwd')) ? App::auth()->getInfo('user_pwd') : ''; + $code = pack('a32', $id) . pack('H*', Crypt::hmac(App::config()->masterKey(), $pw)); return bin2hex($code); } @@ -721,7 +713,7 @@ class ActivityReport $pwd = $pwd['hex']; $sql = new SelectStatement(); - $sql->from(dcCore::app()->prefix . dcAuth::USER_TABLE_NAME) + $sql->from(App::con()->prefix() . App::auth()::USER_TABLE_NAME) ->columns(['user_id', 'user_pwd']) ->where('user_id =' . $sql->quote($user_id)); @@ -731,7 +723,7 @@ class ActivityReport return false; } - if (Crypt::hmac(DC_MASTER_KEY, $rs->f('user_pwd')) != $pwd) { + if (Crypt::hmac(App::config()->masterKey(), $rs->f('user_pwd')) != $pwd) { return false; } diff --git a/src/ActivityRow.php b/src/ActivityRow.php index d4cb196..fe27dae 100644 --- a/src/ActivityRow.php +++ b/src/ActivityRow.php @@ -1,15 +1,5 @@ addBehaviors([ + App::behavior()->addBehaviors([ // dashboard favorites icon 'adminDashboardFavoritesV2' => function (Favorites $favs): void { $favs->register(My::id(), [ @@ -54,14 +47,14 @@ class Backend extends Process 'url' => My::manageUrl(), 'small-icon' => My::icons(), 'large-icon' => My::icons(), - 'permissions' => dcCore::app()->auth->makePermissions([ - dcAuth::PERMISSION_ADMIN, + 'permissions' => App::auth()->makePermissions([ + App::auth()::PERMISSION_ADMIN, ]), ]); }, // dashboard content display 'adminDashboardContentsV2' => function (ArrayObject $items): void { - $db = dcCore::app()->auth->user_prefs?->get(My::id())->get('dashboard_item'); + $db = App::auth()->prefs()->get(My::id())->get('dashboard_item'); $limit = abs(is_numeric($db) ? (int) $db : 0); if (!$limit) { return ; @@ -87,9 +80,9 @@ class Backend extends Process $lines[] = '
' . '' . ActivityReport::parseMessage(__($group->get($row->action)->message), $row->logs) . '
' . __('View all logs') . ' - ' . __('Configure plugin') . '
' . '', @@ -116,7 +109,7 @@ class Backend extends Process }, // dashboard content user preference form 'adminDashboardOptionsFormV2' => function (): void { - $db = dcCore::app()->auth->user_prefs?->get(My::id())->get('dashboard_item'); + $db = App::auth()->prefs()->get(My::id())->get('dashboard_item'); echo (new Div())->class('fieldset')->items([ (new Text('h4', My::name())), @@ -137,7 +130,7 @@ class Backend extends Process // save dashboard content user preference 'adminAfterDashboardOptionsUpdate' => function (?string $user_id = null): void { if (!is_null($user_id)) { - dcCore::app()->auth->user_prefs?->get(My::id())->put( + App::auth()->prefs()->get(My::id())->put( 'dashboard_item', (int) $_POST[My::id() . '_dashboard_item'], 'integer' diff --git a/src/Combo.php b/src/Combo.php index 8530861..77511be 100644 --- a/src/Combo.php +++ b/src/Combo.php @@ -1,21 +1,15 @@ admin->url->redirect('admin.plugins', [ + App::bakend()->url()->redirect('admin.plugins', [ 'module' => My::id(), 'conf' => 1, ]); } catch (Exception $e) { - dcCore::app()->error->add($e->getMessage()); + App::error()->add($e->getMessage()); } return true; @@ -103,19 +97,19 @@ class Config extends Process } $s = ActivityReport::instance()->settings; - $tz = is_string(dcCore::app()->auth->getInfo('user_tz')) ? dcCore::app()->auth->getInfo('user_tz') : 'UTC'; + $tz = is_string(App::auth()->getInfo('user_tz')) ? App::auth()->getInfo('user_tz') : 'UTC'; if (!$s->lastreport) { $last_report = __('never'); $next_report = __('on new activity'); } else { $last_report = Date::str( - dcCore::app()->blog?->settings->get('system')->get('date_format') . ', ' . dcCore::app()->blog?->settings->get('system')->get('time_format'), + App::blog()->settings()->get('system')->get('date_format') . ', ' . App::blog()->settings()->get('system')->get('time_format'), $s->lastreport, $tz ); $next_report = Date::str( - dcCore::app()->blog?->settings->get('system')->get('date_format') . ', ' . dcCore::app()->blog?->settings->get('system')->get('time_format'), + App::blog()->settings()->get('system')->get('date_format') . ', ' . App::blog()->settings()->get('system')->get('time_format'), $s->interval + $s->lastreport, $tz ); @@ -166,11 +160,11 @@ class Config extends Process 'ul', '