]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/friendica/layout.fnk.php
Update strings
[friendica-addons.git] / dav / friendica / layout.fnk.php
index 5b65ec244a11c581c67e08e11c683e6e9ac1a2ad..8a06e64de264e185a8883cfca03914ac04e893d2 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Friendica\Core\Config;
+use Friendica\Core\PConfig;
 
 /**
  *
@@ -23,7 +25,7 @@ function wdcal_addRequiredHeaders()
        $a->page['htmlhead'] .= '<link rel="stylesheet"  type="text/css" href="' . $a->get_baseurl() . '/addon/dav/wdcal/css/calendar.css' . '" media="all" />' . "\r\n";
        $a->page['htmlhead'] .= '<link rel="stylesheet"  type="text/css" href="' . $a->get_baseurl() . '/addon/dav/wdcal/css/main.css' . '" media="all" />' . "\r\n";
 
-       switch (get_config("system", "language")) {
+       switch (Config::get("system", "language")) {
                case "de":
                        $a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/dav/common/wdcal/js/wdCalendar_lang_DE.js"></script>' . "\r\n";
                        $a->page['htmlhead'] .= '<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/dav/jqueryui/jquery.ui.datepicker-de.js"></script>' . "\r\n";
@@ -78,7 +80,7 @@ function wdcal_import_user_ics($calendar_id) {
 
        $server = dav_create_server(true, true, false);
        $calendar = dav_get_current_user_calendar_by_id($server, $calendar_id, DAV_ACL_WRITE);
-       if (!$calendar) goaway($a->get_baseurl() . "/dav/wdcal/");
+       if (!$calendar) goaway('dav/wdcal/');
 
        if (isset($_REQUEST["save"])) {
                check_form_security_token_redirectOnErr('/dav/settings/', 'icsimport');
@@ -86,12 +88,12 @@ function wdcal_import_user_ics($calendar_id) {
                if ($_FILES["ics_file"]["tmp_name"] != "" && is_uploaded_file($_FILES["ics_file"]["tmp_name"])) try {
                        $text = file_get_contents($_FILES["ics_file"]["tmp_name"]);
 
-                       /** @var Sabre_VObject_Component_VCalendar $vObject  */
-                       $vObject        = Sabre_VObject_Reader::read($text);
+                       /** @var Sabre\VObject\Component\VCalendar $vObject  */
+                       $vObject        = Sabre\VObject\Reader::read($text);
                        $comp = $vObject->getComponents();
-                       $imported = array();
+                       $imported = [];
                        foreach ($comp as $c) try {
-                               /** @var Sabre_VObject_Component_VEvent $c */
+                               /** @var Sabre\VObject\Component\VEvent $c */
                                $uid = $c->__get("UID")->value;
                                if (!isset($imported[$uid])) $imported[$uid] = "";
                                $imported[$uid] .= $c->serialize();
@@ -169,18 +171,18 @@ function wdcal_import_user_ics($calendar_id) {
  * @param bool $show_nav
  * @return string
  */
-function wdcal_printCalendar($calendars, $calendars_selected, $data_feed_url, $view = "week", $theme = 0, $height_diff = 175, $readonly = false, $curr_day = "", $add_params = array(), $show_nav = true)
+function wdcal_printCalendar($calendars, $calendars_selected, $data_feed_url, $view = "week", $theme = 0, $height_diff = 175, $readonly = false, $curr_day = "", $add_params = [], $show_nav = true)
 {
 
        $a            = get_app();
        $localization = wdcal_local::getInstanceByUser($a->user["uid"]);
 
        if (count($calendars_selected) == 0) foreach ($calendars as $c) {
-               $prop                 = $c->getProperties(array("id"));
+               $prop                 = $c->getProperties(["id"]);
                $calendars_selected[] = $prop["id"];
        }
 
-       $opts = array(
+       $opts = [
                "view"             => $view,
                "theme"            => $theme,
                "readonly"         => $readonly,
@@ -192,7 +194,7 @@ function wdcal_printCalendar($calendars, $calendars_selected, $data_feed_url, $v
                "date_format_dm3"  => $localization->dateformat_js_dm3(),
                "date_format_full" => $localization->dateformat_datepicker_js(),
                "baseurl"          => $a->get_baseurl() . "/dav/wdcal/",
-       );
+       ];
 
        $x = '
 <script>
@@ -205,7 +207,7 @@ function wdcal_printCalendar($calendars, $calendars_selected, $data_feed_url, $v
        <div class="calselect"><strong>Available Calendars:</strong>';
 
        foreach ($calendars as $cal) {
-               $cal_id = $cal->getProperties(array("id", DAV_DISPLAYNAME));
+               $cal_id = $cal->getProperties(["id", DAV_DISPLAYNAME]);
                $x .= '<label style="margin-left: 10px; margin-right: 10px;"><input type="checkbox" name="cals[]" value="' . $cal_id["id"] . '"';
                $found = false;
                foreach ($calendars_selected as $pre) if ($pre["id"] == $cal_id["id"]) $found = true;
@@ -306,12 +308,12 @@ function wdcal_getDetailPage($calendar_id, $calendarobject_id)
                $calbackend = wdcal_calendar_factory_by_id($calendar_id);
                $redirect   = $calbackend->getItemDetailRedirect($calendar_id, $calendarobject_id);
 
-               if ($redirect !== null) goaway($a->get_baseurl() . $redirect);
+               if ($redirect !== null) goaway($redirect);
 
                $details = $obj;
        } catch (Exception $e) {
                info(t("Error") . ": " . $e);
-               goaway($a->get_baseurl() . "/dav/wdcal/");
+               goaway('dav/wdcal/');
        }
 
        return print_r($details, true);
@@ -357,7 +359,7 @@ function wdcal_getSettingsPage(&$a)
 
        if (isset($_REQUEST["save"])) {
                check_form_security_token_redirectOnErr('/dav/settings/', 'calprop');
-               set_pconfig($a->user["uid"], "dav", "dateformat", $_REQUEST["wdcal_date_format"]);
+               PConfig::set($a->user["uid"], "dav", "dateformat", $_REQUEST["wdcal_date_format"]);
                info(t('The new values have been saved.'));
        }
 
@@ -499,14 +501,14 @@ function wdcal_getSettingsPage(&$a)
 
        $o .= "<br><h3>" . t("Warning") . "</h3>";
 
-       $o .= "This plugin still is in a very early stage of development. Expect major bugs!<br>";
+       $o .= "This addon still is in a very early stage of development. Expect major bugs!<br>";
 
        $o .= "<br><h3>" . t("Synchronization (iPhone, Thunderbird Lightning, Android, ...)") . "</h3>";
 
-       $o .= 'This plugin enables synchronization of your dates and contacts with CalDAV- and CardDAV-enabled programs or devices.<br>
+       $o .= 'This addon enables synchronization of your dates and contacts with CalDAV- and CardDAV-enabled programs or devices.<br>
                As an example, the instructions how to set up two-way synchronization with an iPhone/iPodTouch are provided below.<br>
                Unfortunately, Android does not have native support for CalDAV or CardDAV, so an app has to be installed.<br>
-               On desktops, the Lightning-extension to Mozilla Thunderbird should be able to use this plugin as a backend.<br><br>';
+               On desktops, the Lightning-extension to Mozilla Thunderbird should be able to use this addon as a backend.<br><br>';
 
        $o .= '<h4>' . t('Synchronizing this calendar with the iPhone') . '</h4>';