]> git.mxchange.org Git - friendica.git/blobdiff - mod/cal.php
Move Object\Contact to Model\Contact
[friendica.git] / mod / cal.php
index 4f5bde5d58a5f5447957e0e4dff012a04da86e04..cef9857ea934d84bf794682d2c4744453b6784c4 100644 (file)
@@ -5,14 +5,16 @@
  *     This calendar is for profile visitors and contains only the events
  *     of the profile owner
  */
-
 use Friendica\App;
+use Friendica\Content\Feature;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
+use Friendica\Database\DBM;
+use Friendica\Model\Contact;
 
-require_once('include/event.php');
-require_once('include/redir.php');
+require_once 'include/event.php';
+require_once 'include/redir.php';
 
 function cal_init(App $a) {
        if($a->argc > 1)
@@ -45,7 +47,7 @@ function cal_init(App $a) {
 
                $profile = get_profiledata_by_nick($nick, $a->profile_uid);
 
-               $account_type = account_type($profile);
+               $account_type = Contact::getAccountType($profile);
 
                $tpl = get_markup_template("vcard-widget.tpl");
 
@@ -130,7 +132,7 @@ function cal_content(App $a) {
                        intval($contact_id),
                        intval($a->profile['profile_uid'])
                );
-               if (dbm::is_result($r)) {
+               if (DBM::is_result($r)) {
                        $contact = $r[0];
                        $remote_contact = true;
                }
@@ -225,7 +227,7 @@ function cal_content(App $a) {
 
                $links = array();
 
-               if (dbm::is_result($r)) {
+               if (DBM::is_result($r)) {
                        $r = sort_by_date($r);
                        foreach ($r as $rr) {
                                $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
@@ -239,7 +241,7 @@ function cal_content(App $a) {
                $events=array();
 
                // transform the event in a usable array
-               if (dbm::is_result($r))
+               if (DBM::is_result($r))
                        $r = sort_by_date($r);
                        $events = process_events($r);
 
@@ -299,7 +301,7 @@ function cal_content(App $a) {
 
                // Test permissions
                // Respect the export feature setting for all other /cal pages if it's not the own profile
-               if( ((local_user() !== intval($owner_uid))) && ! feature_enabled($owner_uid, "export_calendar")) {
+               if( ((local_user() !== intval($owner_uid))) && ! Feature::isEnabled($owner_uid, "export_calendar")) {
                        notice( t('Permission denied.') . EOL);
                        goaway('cal/' . $nick);
                }