Yii Framework Forum: [EXTENSION] PcLimitEditTimePeriod - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] PcLimitEditTimePeriod Enables limiting 'update' action to certain time after creatio Rate Topic: -----

#1 User is offline   Boaz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 367
  • Joined: 23-January 11

Posted 19 July 2012 - 01:20 AM

This extension enables limiting the 'update' action (or any action, actually) or a model to a certain timeframe after the creation of that model. This is a common practice in many sites (e.g., LinkedIn, in the 'groups').

Features:
  • Two main modes of operation (provided by two different methods):
    • 'All included' mode: In which when the configurable time period has passed this behavior will intervene the normal operation flow by calling the controller's render() with a predefined view file to show a customizable 'edit period expired' message. This mode requires as little as possible changes required on the controller/model classes.
    • 'Just advise' mode: This mode is used to only advise the client code if edit is allowed or not. No rendering or anything is done. This allows for greater flexibility and customizing of workflow via your code.
  • Configurable 'edit timeout' per model class, with a default of 60 min.
  • Supports two formats for 'created on' value in the AR model - int (typical when using unix timestamps) or a string that can be used to initialize a DateTime object (supported formats: http://php.net/manua...ime.formats.php).
  • Customizable 'created on' attribute name per model class.
  • Can use logging. This is configurable. Default = yes, will use logging.
  • Customizable 'edit period expired' message per model class. This is useful if one class requires specific notification message shown to the user. This is relevant only in 'all included' mode (see above).

You're invited to check it out, here.

Boaz.
Therapeutic PHP sessions My LinkedIn Profile
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users