[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/tests/phpunit/assets/ -> group-extensions.php (source)

   1  <?php
   2  
   3  /**
   4   * The following implementations of BP_Group_Extension act as dummy plugins
   5   * for our unit tests
   6   */
   7  
   8  class BPTest_Group_Extension_Parse_Legacy_Properties extends BP_Group_Extension {
   9  	function __construct() {
  10          $class_name = get_class( $this );
  11          $this->name = $class_name;
  12          $this->slug = sanitize_title( $class_name );
  13          $this->admin_name = $this->name . ' Edit';
  14          $this->admin_slug = $this->slug . '-edit';
  15          $this->create_name = $this->name . ' Create';
  16          $this->create_slug = $this->slug . '-create';
  17          $this->visibility = 'private';
  18          $this->create_step_position = 58;
  19          $this->nav_item_position = 63;
  20          $this->admin_metabox_context = 'high';
  21          $this->admin_metabox_priority = 'side';
  22          $this->enable_create_step = false;
  23          $this->enable_nav_item = true;
  24          $this->enable_edit_item = false;
  25          $this->enable_admin_item = true;
  26          $this->nav_item_name = $this->name . ' Nav';
  27          $this->display_hook = 'foo_hook';
  28          $this->template_file = 'foo_template';
  29      }
  30  
  31      /**
  32       * Provides access to protected method unneeded in BP
  33       */
  34  	function _parse_legacy_properties() {
  35          return $this->parse_legacy_properties();
  36      }
  37  
  38      /**
  39       * Provides access to protected property unneeded in BP
  40       */
  41  	function _get_legacy_properties_converted() {
  42          return $this->legacy_properties_converted;
  43      }
  44  }
  45  
  46  class BPTest_Group_Extension_Setup_Screens_Use_Global_Fallbacks extends BP_Group_Extension {
  47  	function __construct() {
  48          $class_name = get_class( $this );
  49          $this->slug = sanitize_title( $class_name );
  50          $this->name = $class_name;
  51      }
  52  
  53      /**
  54       * Provides access to protected method unneeded in BP
  55       */
  56  	function _get_default_screens() {
  57          return $this->get_default_screens();
  58      }
  59  
  60      /**
  61       * Provides access to protected method unneeded in BP
  62       */
  63  	function _setup_class_info() {
  64          return $this->setup_class_info();
  65      }
  66  
  67  	function settings_screen( $group_id = null ) {}
  68  	function settings_screen_save( $group_id = null ) {}
  69  }
  70  
  71  class BPTest_Group_Extension_Setup_Screens_Define_Edit_Screens_Locally extends BP_Group_Extension {
  72  	function __construct() {
  73          $class_name = get_class( $this );
  74          $this->slug = sanitize_title( $class_name );
  75          $this->name = $class_name;
  76      }
  77  
  78  	function edit_screen( $group_id = null ) {}
  79  	function edit_screen_save( $group_id = null ) {}
  80  	function settings_screen( $group_id = null ) {}
  81  	function settings_screen_save( $group_id = null ) {}
  82  
  83      /**
  84       * Provides access to protected method unneeded in BP
  85       */
  86  	function _get_default_screens() {
  87          return $this->get_default_screens();
  88      }
  89  
  90      /**
  91       * Provides access to protected method unneeded in BP
  92       */
  93  	function _setup_class_info() {
  94          return $this->setup_class_info();
  95      }
  96  
  97  }
  98  
  99  class BPTest_Group_Extension_Access_Root_Property extends BP_Group_Extension {
 100  	function __construct() {
 101          $class_name = get_class( $this );
 102  
 103          $args = array(
 104              'slug' => sanitize_title( $class_name ),
 105              'name' => $class_name,
 106              'nav_item_position' => 39,
 107          );
 108  
 109          parent::init( $args );
 110      }
 111  }
 112  
 113  class BPTest_Group_Extension_Access_Init_Property_Using_Legacy_Location extends BP_Group_Extension {
 114  	function __construct() {
 115          $class_name = get_class( $this );
 116  
 117          $args = array(
 118              'slug' => sanitize_title( $class_name ),
 119              'name' => $class_name,
 120              'screens' => array(
 121                  'create' => array(
 122                      'position' => 18,
 123                  ),
 124              ),
 125          );
 126  
 127          parent::init( $args );
 128      }
 129  }
 130  
 131  class BPTest_Group_Extension_Get_Screen_Callback_Fallbacks extends BP_Group_Extension {
 132  	function __construct() {
 133          $class_name = get_class( $this );
 134  
 135          $args = array(
 136              'slug' => sanitize_title( $class_name ),
 137              'name' => $class_name,
 138          );
 139  
 140          parent::init( $args );
 141      }
 142  
 143  	function settings_screen( $group_id = null ) {}
 144  	function settings_screen_save( $group_id = null ) {}
 145  
 146  	function edit_screen( $group_id = null ) {}
 147  	function edit_screen_save( $group_id = null ) {}
 148  }
 149  
 150  class BPTest_Group_Extension_Enable_Nav_Item_True extends BP_Group_Extension {
 151  	public function __construct() {
 152          $class_name = get_class( $this );
 153  
 154          $args = array(
 155              'name' => $class_name,
 156              'slug' => sanitize_title( $class_name ),
 157              'enable_nav_item' => true,
 158          );
 159  
 160          parent::init( $args );
 161      }
 162  }
 163  
 164  class BPTest_Group_Extension_Enable_Nav_Item_False extends BP_Group_Extension {
 165  	public function __construct() {
 166          $class_name = get_class( $this );
 167  
 168          $args = array(
 169              'name' => $class_name,
 170              'slug' => sanitize_title( $class_name ),
 171              'enable_nav_item' => false,
 172          );
 173  
 174          parent::init( $args );
 175      }
 176  }
 177  
 178  class BPTest_Group_Extension_Visibility_Private extends BP_Group_Extension {
 179  	public function __construct() {
 180          $class_name = get_class( $this );
 181  
 182          $args = array(
 183              'name' => $class_name,
 184              'slug' => sanitize_title( $class_name ),
 185              'visibility' => 'private',
 186          );
 187  
 188          parent::init( $args );
 189      }
 190  }
 191  
 192  class BPTest_Group_Extension_Visibility_Public extends BP_Group_Extension {
 193  	public function __construct() {
 194          $class_name = get_class( $this );
 195  
 196          $args = array(
 197              'name' => $class_name,
 198              'slug' => sanitize_title( $class_name ),
 199              'visibility' => 'public',
 200          );
 201  
 202          parent::init( $args );
 203      }
 204  }
 205  
 206  class BPTest_Group_Extension_Inferred_Access_Settings_EnableNavItem_True extends BP_Group_Extension {
 207  	public function __construct() {
 208          $class_name = get_class( $this );
 209  
 210          $args = array(
 211              'name' => $class_name,
 212              'slug' => sanitize_title( $class_name ),
 213              'enable_nav_item' => true,
 214          );
 215  
 216          parent::init( $args );
 217      }
 218  }
 219  
 220  class BPTest_Group_Extension_Inferred_Access_Settings_EnableNavItem_False extends BP_Group_Extension {
 221  	public function __construct() {
 222          $class_name = get_class( $this );
 223  
 224          $args = array(
 225              'name' => $class_name,
 226              'slug' => sanitize_title( $class_name ),
 227              'enable_nav_item' => false,
 228          );
 229  
 230          parent::init( $args );
 231      }
 232  }
 233  class BPTest_Group_Extension_Access_Anyone extends BP_Group_Extension {
 234  	public function __construct() {
 235          $class_name = get_class( $this );
 236  
 237          $args = array(
 238              'name' => $class_name,
 239              'slug' => sanitize_title( $class_name ),
 240              'access' => 'anyone',
 241          );
 242  
 243          parent::init( $args );
 244      }
 245  }
 246  
 247  class BPTest_Group_Extension_Access_Loggedin extends BP_Group_Extension {
 248  	public function __construct() {
 249          $class_name = get_class( $this );
 250  
 251          $args = array(
 252              'name' => $class_name,
 253              'slug' => sanitize_title( $class_name ),
 254              'access' => 'loggedin',
 255          );
 256  
 257          parent::init( $args );
 258      }
 259  }
 260  
 261  class BPTest_Group_Extension_Access_Member extends BP_Group_Extension {
 262  	public function __construct() {
 263          $class_name = get_class( $this );
 264  
 265          $args = array(
 266              'name' => $class_name,
 267              'slug' => sanitize_title( $class_name ),
 268              'access' => 'member',
 269          );
 270  
 271          parent::init( $args );
 272      }
 273  }
 274  
 275  class BPTest_Group_Extension_Access_AdminMod extends BP_Group_Extension {
 276  	public function __construct() {
 277          $class_name = get_class( $this );
 278  
 279          $args = array(
 280              'name' => $class_name,
 281              'slug' => sanitize_title( $class_name ),
 282              'access' => array(
 283                  'mod',
 284                  'admin',
 285              ),
 286          );
 287  
 288          parent::init( $args );
 289      }
 290  }
 291  
 292  class BPTest_Group_Extension_Access_Admin extends BP_Group_Extension {
 293  	public function __construct() {
 294          $class_name = get_class( $this );
 295  
 296          $args = array(
 297              'name' => $class_name,
 298              'slug' => sanitize_title( $class_name ),
 299              'access' => 'admin',
 300          );
 301  
 302          parent::init( $args );
 303      }
 304  }
 305  
 306  class BPTest_Group_Extension_Access_Noone extends BP_Group_Extension {
 307  	public function __construct() {
 308          $class_name = get_class( $this );
 309  
 310          $args = array(
 311              'name' => $class_name,
 312              'slug' => sanitize_title( $class_name ),
 313              'access' => 'noone',
 314          );
 315  
 316          parent::init( $args );
 317      }
 318  }
 319  
 320  class BPTest_Group_Extension_ShowTab_Anyone extends BP_Group_Extension {
 321  	public function __construct() {
 322          $class_name = get_class( $this );
 323  
 324          $args = array(
 325              'name' => $class_name,
 326              'slug' => sanitize_title( $class_name ),
 327              'access' => 'admin',
 328              'show_tab' => 'anyone',
 329          );
 330  
 331          parent::init( $args );
 332      }
 333  }
 334  
 335  class BPTest_Group_Extension_ShowTab_Loggedin extends BP_Group_Extension {
 336  	public function __construct() {
 337          $class_name = get_class( $this );
 338  
 339          $args = array(
 340              'name' => $class_name,
 341              'slug' => sanitize_title( $class_name ),
 342              'access' => 'admin',
 343              'show_tab' => 'loggedin',
 344          );
 345  
 346          parent::init( $args );
 347      }
 348  }
 349  
 350  class BPTest_Group_Extension_ShowTab_Member extends BP_Group_Extension {
 351  	public function __construct() {
 352          $class_name = get_class( $this );
 353  
 354          $args = array(
 355              'name' => $class_name,
 356              'slug' => sanitize_title( $class_name ),
 357              'access' => 'admin',
 358              'show_tab' => 'member',
 359          );
 360  
 361          parent::init( $args );
 362      }
 363  }
 364  
 365  class BPTest_Group_Extension_ShowTab_AdminMod extends BP_Group_Extension {
 366  	public function __construct() {
 367          $class_name = get_class( $this );
 368  
 369          $args = array(
 370              'name' => $class_name,
 371              'slug' => sanitize_title( $class_name ),
 372              'access' => 'admin',
 373              'show_tab' => array(
 374                  'mod',
 375                  'admin',
 376              ),
 377          );
 378  
 379          parent::init( $args );
 380      }
 381  }
 382  
 383  class BPTest_Group_Extension_ShowTab_Admin extends BP_Group_Extension {
 384  	public function __construct() {
 385          $class_name = get_class( $this );
 386  
 387          $args = array(
 388              'name' => $class_name,
 389              'slug' => sanitize_title( $class_name ),
 390              'access' => 'admin',
 391              'show_tab' => 'admin',
 392          );
 393  
 394          parent::init( $args );
 395      }
 396  }
 397  
 398  class BPTest_Group_Extension_ShowTab_Noone extends BP_Group_Extension {
 399  	public function __construct() {
 400          $class_name = get_class( $this );
 401  
 402          $args = array(
 403              'name' => $class_name,
 404              'slug' => sanitize_title( $class_name ),
 405              'access' => 'noone',
 406              'show_tab' => 'noone',
 407          );
 408  
 409          parent::init( $args );
 410      }
 411  }
 412  
 413  class BPTest_Group_Extension_Widget_Method extends BP_Group_Extension {
 414  	public function __construct() {
 415          $class_name = get_class( $this );
 416  
 417          $args = array(
 418              'name' => $class_name,
 419              'slug' => sanitize_title( $class_name ),
 420          );
 421  
 422          parent::init( $args );
 423      }
 424  
 425  	public function widget_display() {
 426          echo 'Widget Displayed';
 427      }
 428  }


Generated: Thu Dec 26 01:01:04 2024 Cross-referenced by PHPXref 0.7.1