GithubHelp home page GithubHelp logo

wernerjoss / grav-plugin-caldav2ics Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 547 KB

Create ICS File(s) from remote CalDav Calendar(s)

License: MIT License

PHP 100.00%
caldav-calendar grav-cms grav-scheduler ics

grav-plugin-caldav2ics's People

Contributors

wernerjoss avatar

Watchers

 avatar

grav-plugin-caldav2ics's Issues

Remarks on "onAdminAfterSave" and "$config['enabled']"

  • onAdminAfterSave and $config = $this->config()
    The name onAdminAfterSave may cause some confusion. Although the data has been saved to disk, the variable $config does NOT reflect the newly saved data, but instead still reflects the previous state.

    To get the newly saved data, you need to reference $event['object'], which contains the data being submitted by the user.

    /** @var Data */
    $data = $event['object'];   <-- Contains the new data submitted by Admin
    $isEnabled = $data['enabled'];
    $hasJobsEnabled = $data['scheduled_jobs']['enabled'];
    
  • $config['enabled'] is quite useless.
    If the plugin is not enabled, function getSubscribedEvents() will not be called and hence your events will not be enabled and $config['enabled'] will never be evaluated. On the other hand, if the plugin is enabled, $config['enabled'] will always be 'true'.

  • To skip processing of onAdminAfterSaved on every submit of Admin you could do:

    /** @var Uri */
    $uri = $this->grav['uri'];
    
    if ('caldav2ics' !== $uri->basename()) {
         return;
    }
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.