28 if (!($config instanceof \stdClass)) {
29 $config = new \stdClass();
31 $this->CONFIG = $config;
57 $name = trim(strtolower(
$name));
73 $item->location = $location;
76 if ($GLOBALS[
'_ELGG']->externals[
$type]->contains(
$item)) {
82 $item = new \stdClass();
83 $item->loaded =
false;
85 $item->location = $location;
107 $name = trim(strtolower(
$name));
111 unset($GLOBALS[
'_ELGG']->externals_map[
$type][
$name]);
112 return $GLOBALS[
'_ELGG']->externals[
$type]->remove(
$item);
131 $name = trim(strtolower(
$name));
137 $item->loaded =
true;
139 $item = new \stdClass();
140 $item->loaded =
true;
142 $item->location =
'';
144 $GLOBALS[
'_ELGG']->externals[
$type]->add(
$item);
161 isset($GLOBALS[
'_ELGG']->externals)
162 && isset($GLOBALS[
'_ELGG']->externals[
$type])
165 $items = $GLOBALS[
'_ELGG']->externals[
$type]->getElements();
167 $items = array_filter(
$items,
function($v) use ($location) {
168 return $v->loaded ==
true && $v->location == $location;
171 array_walk(
$items,
function(&$v, $k){
188 if (!isset($GLOBALS[
'_ELGG']->externals)) {
189 $GLOBALS[
'_ELGG']->externals = array();
193 $GLOBALS[
'_ELGG']->externals[
$type] = new \ElggPriorityList();
196 if (!isset($GLOBALS[
'_ELGG']->externals_map)) {
197 $GLOBALS[
'_ELGG']->externals_map = array();
200 if (!isset($GLOBALS[
'_ELGG']->externals_map[
$type])) {
201 $GLOBALS[
'_ELGG']->externals_map[
$type] = array();
if($guid==elgg_get_logged_in_user_guid()) $name
bootstrap($type)
Bootstraps the externals data structure in $_ELGG.
getLoadedFiles($type, $location)
Get external resource descriptors.
unregister($type, $name)
Unregister an external file.
__construct(\stdClass $config=null)
Constructor.
load($type, $name)
Load an external resource for use on this page.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if(! $display_name) $type
elgg_format_url($url)
Handles formatting of ampersands in urls.