M_Rule

The Membership 2 M Rule class.

Defined (1)

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

/app_old/membershipincludes/classes/class.rule.php  
  1. class M_Rule { 
  2.  
  3. var $data; 
  4. var $name = 'none'; 
  5. var $label = 'None Set'; 
  6. var $description = ''; 
  7.  
  8. // The area of the rule - public, admin or core 
  9. var $rulearea = 'public'; 
  10.  
  11. var $level_id = false; 
  12.  
  13. function __construct( $level_id = false ) { 
  14. // Store the level this rule is for 
  15. $this->level_id = $level_id; 
  16.  
  17. $this->on_creation(); 
  18.  
  19. function M_Rule( $tst ) { 
  20. $this->__construct(); 
  21.  
  22. function admin_sidebar($data) { 
  23. ?> 
  24. <li class='draggable-level' id='<?php echo $this->name; ?>' <?php if($data === true) echo "style='display:none;'"; ?>> 
  25. <div class='action action-draggable'> 
  26. <div class='action-top closed'> 
  27. <a href="#available-actions" class="action-button hide-if-no-js"></a> 
  28. <?php _e($this->label, 'membership'); ?> 
  29. </div> 
  30. <div class='action-body closed'> 
  31. <?php if(!empty($this->description)) { ?> 
  32. <p> 
  33. <?php _e($this->description, 'membership'); ?> 
  34. </p> 
  35. <?php } ?> 
  36. <p> 
  37. <a href='#addtopositive' class='action-to-positive' title='<?php _e('Add this rule to the positive area of the membership level.', 'membership'); ?>'><?php _e('Add to Positive rules', 'membership'); ?></a><a href='#addtonegative' class='action-to-negative' title='<?php _e('Add this rule to the negative area of the membership level.', 'membership'); ?>'><?php _e('Add to Negative rules', 'membership'); ?></a> 
  38. </p> 
  39. </div> 
  40. </div> 
  41. </li> 
  42. <?php 
  43.  
  44. function admin_main($data) { 
  45.  
  46.  
  47. // Operations 
  48. function on_creation() { 
  49.  
  50.  
  51. function on_positive($data) { 
  52. $this->data = $data; 
  53.  
  54. function on_negative($data) { 
  55. $this->data = $data; 
  56.  
  57. // Getters and Setters 
  58. function is_adminside() { 
  59. if( in_array($this->rulearea, array('admin', 'core')) ) { 
  60. return true; 
  61. } else { 
  62. return false; 
  63.  
  64.