28 if (!($config instanceof \
stdClass)) {
29 $config = new \stdClass();
31 $this->CONFIG = $config;
48 if (empty($name) || empty($url)) {
57 $name = trim(strtolower($name));
60 if (!is_numeric($priority)) {
65 $priority = max((
int)$priority, 0);
73 $item->location = $location;
77 $priority = $GLOBALS[
'_ELGG']->externals[
$type]->move(
$item, $priority);
79 $priority = $GLOBALS[
'_ELGG']->externals[
$type]->add(
$item, $priority);
82 $item = new \stdClass();
83 $item->loaded =
false;
85 $item->location = $location;
87 $priority = $GLOBALS[
'_ELGG']->externals[
$type]->add(
$item, $priority);
92 return $priority !==
false;
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();
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();
192 if (!isset($GLOBALS[
'_ELGG']->externals[
$type]) || !$GLOBALS[
'_ELGG']->externals[$type] instanceof \
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();
__construct(\stdClass $config=null)
Constructor.
if($guid==elgg_get_logged_in_user_guid()) $name
bootstrap($type)
Bootstraps the externals data structure in $_ELGG.
elgg ElggPriorityList
Priority lists allow you to create an indexed list that can be iterated through in a specific order...
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_format_url($url)
Handles formatting of ampersands in urls.
getLoadedFiles($type, $location)
Get external resource descriptors.
load($type, $name)
Load an external resource for use on this page.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it contains
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
unregister($type, $name)
Unregister an external file.