Elgg  Version 3.0
constants.php
Go to the documentation of this file.
1 <?php
2 
11 define('ACCESS_DEFAULT', -1);
12 define('ACCESS_PRIVATE', 0);
13 define('ACCESS_LOGGED_IN', 1);
14 define('ACCESS_PUBLIC', 2);
15 define('ACCESS_FRIENDS', -2);
16 
24 define('ELGG_ENTITIES_ANY_VALUE', null);
25 
33 define('ELGG_ENTITIES_NO_VALUE', 0);
34 
42 define('REFERRER', -1);
43 
52 define('REFERER', -1);
53 
57 define('ELGG_HTTP_CONTINUE', 100);
58 define('ELGG_HTTP_SWITCHING_PROTOCOLS', 101);
59 define('ELGG_HTTP_PROCESSING', 102);// RFC2518
60 define('ELGG_HTTP_OK', 200);
61 define('ELGG_HTTP_CREATED', 201);
62 define('ELGG_HTTP_ACCEPTED', 202);
63 define('ELGG_HTTP_NON_AUTHORITATIVE_INFORMATION', 203);
64 define('ELGG_HTTP_NO_CONTENT', 204);
65 define('ELGG_HTTP_RESET_CONTENT', 205);
66 define('ELGG_HTTP_PARTIAL_CONTENT', 206);
67 define('ELGG_HTTP_MULTI_STATUS', 207); // RFC4918
68 define('ELGG_HTTP_ALREADY_REPORTED', 208); // RFC5842
69 define('ELGG_HTTP_IM_USED', 226); // RFC3229
70 define('ELGG_HTTP_MULTIPLE_CHOICES', 300);
71 define('ELGG_HTTP_MOVED_PERMANENTLY', 301);
72 define('ELGG_HTTP_FOUND', 302);
73 define('ELGG_HTTP_SEE_OTHER', 303);
74 define('ELGG_HTTP_NOT_MODIFIED', 304);
75 define('ELGG_HTTP_USE_PROXY', 305);
76 define('ELGG_HTTP_RESERVED', 306);
77 define('ELGG_HTTP_TEMPORARY_REDIRECT', 307);
78 define('ELGG_HTTP_PERMANENTLY_REDIRECT', 308); // RFC7238
79 define('ELGG_HTTP_BAD_REQUEST', 400);
80 define('ELGG_HTTP_UNAUTHORIZED', 401);
81 define('ELGG_HTTP_PAYMENT_REQUIRED', 402);
82 define('ELGG_HTTP_FORBIDDEN', 403);
83 define('ELGG_HTTP_NOT_FOUND', 404);
84 define('ELGG_HTTP_METHOD_NOT_ALLOWED', 405);
85 define('ELGG_HTTP_NOT_ACCEPTABLE', 406);
86 define('ELGG_HTTP_PROXY_AUTHENTICATION_REQUIRED', 407);
87 define('ELGG_HTTP_REQUEST_TIMEOUT', 408);
88 define('ELGG_HTTP_CONFLICT', 409);
89 define('ELGG_HTTP_GONE', 410);
90 define('ELGG_HTTP_LENGTH_REQUIRED', 411);
91 define('ELGG_HTTP_PRECONDITION_FAILED', 412);
92 define('ELGG_HTTP_REQUEST_ENTITY_TOO_LARGE', 413);
93 define('ELGG_HTTP_REQUEST_URI_TOO_LONG', 414);
94 define('ELGG_HTTP_UNSUPPORTED_MEDIA_TYPE', 415);
95 define('ELGG_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE', 416);
96 define('ELGG_HTTP_EXPECTATION_FAILED', 417);
97 define('ELGG_HTTP_I_AM_A_TEAPOT', 418); // RFC2324
98 define('ELGG_HTTP_UNPROCESSABLE_ENTITY', 422);// RFC4918
99 define('ELGG_HTTP_LOCKED', 423); // RFC4918
100 define('ELGG_HTTP_FAILED_DEPENDENCY', 424); // RFC4918
101 define('ELGG_HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL', 425); // RFC2817
102 define('ELGG_HTTP_UPGRADE_REQUIRED', 426);// RFC2817
103 define('ELGG_HTTP_PRECONDITION_REQUIRED', 428); // RFC6585
104 define('ELGG_HTTP_TOO_MANY_REQUESTS', 429); // RFC6585
105 define('ELGG_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE', 431); // RFC6585
106 define('ELGG_HTTP_INTERNAL_SERVER_ERROR', 500);
107 define('ELGG_HTTP_NOT_IMPLEMENTED', 501);
108 define('ELGG_HTTP_BAD_GATEWAY', 502);
109 define('ELGG_HTTP_SERVICE_UNAVAILABLE', 503);
110 define('ELGG_HTTP_GATEWAY_TIMEOUT', 504);
111 define('ELGG_HTTP_VERSION_NOT_SUPPORTED', 505);
112 define('ELGG_HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL', 506);// RFC2295
113 define('ELGG_HTTP_INSUFFICIENT_STORAGE', 507);// RFC4918
114 define('ELGG_HTTP_LOOP_DETECTED', 508); // RFC5842
115 define('ELGG_HTTP_NOT_EXTENDED', 510);// RFC2774
116 define('ELGG_HTTP_NETWORK_AUTHENTICATION_REQUIRED', 511); // RFC6585
117 
121 define('ELGG_JSON_ENCODING', JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
122 
126 define('ELGG_PLUGIN_USER_SETTING_PREFIX', 'plugin:user_setting:');
127 
133 define('ELGG_PLUGIN_INTERNAL_PREFIX', 'elgg:internal:');
134 
138 define('ELGG_VALUE_INTEGER', 'integer');
139 define('ELGG_VALUE_STRING', 'string');
140 define('ELGG_VALUE_GUID', 'guid');
141 define('ELGG_VALUE_ID', 'id');
142 define('ELGG_VALUE_TIMESTAMP', 'timestamp');
143 
147 define('ELGG_CACHE_BLACK_HOLE', 1);
148 define('ELGG_CACHE_RUNTIME', 2);
149 define('ELGG_CACHE_FILESYSTEM', 4);
150 define('ELGG_CACHE_PERSISTENT', 8);
151 define('ELGG_CACHE_APC', 16);
152 
156 define('ELGG_IGNORE_ACCESS', 1);
157 define('ELGG_ENFORCE_ACCESS', 2);
158 define('ELGG_SHOW_DISABLED_ENTITIES', 4);
159 define('ELGG_HIDE_DISABLED_ENTITIES', 8);
define(function(require){var $=require('jquery');var elgg=require('elgg');var spinner=require('elgg/spinner');var Ajax=require('elgg/Ajax');var ajax=new Ajax();function init(){initPluginReordering();$(document).on('click', '.elgg-admin-plugins-categories a', filterPluginCategory);$(document).on('click', '.elgg-plugins-toggle', toggleAllPlugins);$(document).on('click', '.elgg-plugin-state-change', toggleSinglePlugin);$(document).on('mouseenter', '.elgg-plugin-details-screenshots.elgg-plugin-screenshot', showPluginScreenshot);};function freezePlugins(){$('#elgg-plugin-list-cover').css('display', 'block');};function unfreezePlugins(){$('#elgg-plugin-list-cover').css('display', 'none');};function initPluginReordering(){$('#elgg-plugin-list > ul').sortable({items: 'li:has(>.elgg-state-draggable)', handle: '.elgg-body', forcePlaceholderSize:true, placeholder: 'elgg-plugin-placeholder', opacity:0.8, revert:500, stop:movePlugin});};function toggleSinglePlugin(e){freezePlugins();e.preventDefault();ajax.action(this.href).done(function(output, statusText, jqXHR){if(jqXHR.AjaxData.status==-1){location.reload();return;}ajax.path('admin_plugins_refresh').done(function(output){$('#elgg-plugin-list').html(output.list);$('.elgg-sidebar').html(output.sidebar);$(".elgg-admin-plugins-categories > li.elgg-state-selected > a").trigger('click');initPluginReordering();unfreezePlugins();});});};function toggleAllPlugins(e){e.preventDefault();if(!confirm(elgg.echo('question:areyousure'))){return;}freezePlugins();var guids=[], state=$(this).data('desiredState'), find_state=state== 'active'? 'inactive': 'active';$('.elgg-plugin.elgg-state-'+find_state+ ':visible').each(function(){var guid=$(this).data('guid');if(guid){guids.push(guid);}});if(!guids.length){elgg.register_error(elgg.echo('admin:plugins:already:'+state));unfreezePlugins();return;}spinner.start();var $form=$('< form method="post"/>');$form.prop('action', elgg.security.addToken(this.href));$form.append('< input type="hidden"name="guids"value="' + guids.join(',') + '"/>');$form.appendTo("body").submit();};function movePlugin(e, ui){freezePlugins();var pluginGuid=ui.item.attr('id');pluginGuid=pluginGuid.replace('elgg-object-', '');elgg.action('admin/plugins/set_priority',{data:{plugin_guid:pluginGuid, priority:ui.item.index()+1}, success:function(){var priorityDep=new RegExp(elgg.echo('ElggPlugin:Dependencies:Priority'));ui.item.siblings().andSelf().each(function(){if(priorityDep.test($(this).find('.elgg-dependency-requires').text())){updatePluginView($(this));}});unfreezePlugins();}});};function updatePluginView(pluginView){var pluginGuid=pluginView.attr('id');pluginGuid=pluginGuid.replace('elgg-object-', '');elgg.get({url:elgg.config.wwwroot+"ajax/view/object/plugin/full", dataType:"html", cache:false, data:{guid:pluginGuid, display_reordering:true}, success:function(htmlData){if(htmlData.length > 0){pluginView.html(htmlData);}}});};function filterPluginCategory(e){e.preventDefault();$(".elgg-admin-plugins-categories > li").removeClass("elgg-state-selected");$(".elgg-plugin").hide();$(".elgg-plugin-category-"+$(this).attr("rel")).show();$(this).closest('li').addClass("elgg-state-selected");};function showPluginScreenshot(){$(this).parent().find(".elgg-plugin-screenshot").removeClass("elgg-state-selected");$(this).addClass("elgg-state-selected");$(".elgg-plugin-details-screenshots > div > img").hide();$(".elgg-plugin-details-screenshots > div > img[rel='"+$(this).attr("rel")+"']").show();};init();})