GFAddonLocking

The Gravity Forms GFAddonLocking class.

Defined (1)

The class is defined in the following location(s).

/includes/addon/class-gf-addon-locking.php  
  1. class GFAddonLocking extends GFLocking { 
  2. protected $_strings; 
  3. /** @var GFAddOn $_addon */ 
  4. protected $_addon; 
  5.  
  6. /** 
  7. * e.g. 
  8. * array( 
  9. * "object_type" => 'contact',  
  10. * "capabilities" => array("gravityforms_contacts_edit_contacts"),  
  11. * "redirect_url" => admin_url("admin.php?page=gf_contacts"),  
  12. * "edit_url" => admin_url(sprintf("admin.php?page=gf_contacts&id=%d", $contact_id)),  
  13. * "strings" => $strings 
  14. * ); 
  15. * @param array $config 
  16. * @param GFAddOn $addon 
  17. */ 
  18. public function __construct( $config, $addon ) { 
  19. $this->_addon = $addon; 
  20. $capabilities = isset( $config['capabilities'] ) ? $config['capabilities'] : array(); 
  21. $redirect_url = isset( $config['redirect_url'] ) ? $config['redirect_url'] : ''; 
  22. $edit_url = isset( $config['edit_url'] ) ? $config['edit_url'] : ''; 
  23. $object_type = isset( $config['object_type'] ) ? $config['object_type'] : ''; 
  24. $this->_strings = isset( $config['strings'] ) ? $config['strings'] : array(); 
  25. parent::__construct( $object_type, $redirect_url, $edit_url, $capabilities ); 
  26.  
  27. public function get_strings() { 
  28. return array_merge( parent::get_strings(), $this->_strings ); 
  29.  
  30. protected function is_edit_page() { 
  31. return $this->_addon->is_locking_edit_page(); 
  32.  
  33. protected function is_list_page() { 
  34. return $this->_addon->is_locking_list_page(); 
  35.  
  36. protected function is_view_page() { 
  37. return $this->_addon->is_locking_view_page(); 
  38.  
  39. protected function get_object_id() { 
  40. return $this->_addon->get_locking_object_id(); 
  41.  
  42. protected function is_object_locked( $object_id ) { 
  43. return $this->is_object_locked( $object_id );