-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site template visibility settings, ported from CBOX-OL.
Some monkey patching is required, particularly in the front-end query for site templates. This is because in CBOX-OL, the site template selector appears during a step of group creation when the group exists, while on the OpenLab, it's on the first (pre-group- creation) step. See #3247. See cuny-academic-commons/commons-in-a-box#472.
- Loading branch information
1 parent
e634513
commit 7999085
Showing
14 changed files
with
1,179 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
wp-content/plugins/wds-citytech/includes/cbox-polyfills/class-cbox-academic-unit-type.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
class CBOX_Academic_Unit_Type { | ||
protected $slug; | ||
protected $name; | ||
protected $parent; | ||
protected $group_types = []; | ||
|
||
public function __construct( $args ) { | ||
$string_keys = [ 'slug', 'name', 'parent' ]; | ||
foreach ( $string_keys as $key ) { | ||
if ( isset( $args[ $key ] ) ) { | ||
$this->$key = (string) $args[ $key ]; | ||
} | ||
} | ||
|
||
if ( isset( $args['group_types'] ) ) { | ||
$this->group_types = (array) $args['group_types']; | ||
} | ||
} | ||
|
||
public function get_slug() { | ||
return $this->slug; | ||
} | ||
|
||
public function get_name() { | ||
return $this->name; | ||
} | ||
|
||
public function get_parent() { | ||
return $this->parent; | ||
} | ||
|
||
public function get_group_types() { | ||
return $this->group_types; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
wp-content/plugins/wds-citytech/includes/cbox-polyfills/class-cbox-academic-unit.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
class CBOX_Academic_Unit { | ||
protected $name; | ||
protected $parent; | ||
protected $slug; | ||
protected $type; | ||
|
||
public function __construct( $args ) { | ||
$string_keys = [ 'name', 'parent', 'slug', 'type' ]; | ||
foreach ( $string_keys as $key ) { | ||
if ( isset( $args[ $key ] ) ) { | ||
$this->$key = (string) $args[ $key ]; | ||
} | ||
} | ||
} | ||
|
||
public function get_name() { | ||
return $this->name; | ||
} | ||
|
||
public function get_parent() { | ||
return $this->parent; | ||
} | ||
|
||
public function get_slug() { | ||
return $this->slug; | ||
} | ||
|
||
public function get_type() { | ||
return $this->type; | ||
} | ||
|
||
public function get_wp_post_id() { | ||
return $this->get_slug(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
wp-content/plugins/wds-citytech/includes/cbox-polyfills/class-cbox-member-type.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
class CBOX_Member_Type { | ||
protected $slug; | ||
protected $name; | ||
protected $can_create_courses; | ||
|
||
public function __construct( $args ) { | ||
$string_keys = [ 'slug', 'name' ]; | ||
foreach ( $string_keys as $key ) { | ||
if ( isset( $args[ $key ] ) ) { | ||
$this->$key = (string) $args[ $key ]; | ||
} | ||
} | ||
|
||
$bool_keys = [ 'can_create_courses' ]; | ||
foreach ( $bool_keys as $key ) { | ||
if ( isset( $args[ $key ] ) ) { | ||
$this->$key = (bool) $args[ $key ]; | ||
} | ||
} | ||
} | ||
|
||
public function get_slug() { | ||
return $this->slug; | ||
} | ||
|
||
public function get_name() { | ||
return $this->name; | ||
} | ||
|
||
public function get_label() { | ||
return $this->name; | ||
} | ||
|
||
public function get_can_create_courses() { | ||
return $this->can_create_courses; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.