10 elgg.provide(
'elgg.admin');
12 elgg.admin.init =
function () {
15 $(
'.elgg-system-messages li').stop(
true);
16 $(
'.elgg-system-messages li').die(
'click');
17 $(
'.elgg-system-messages li').live(
'click',
function() {
18 $(
this).stop().slideUp(
'medium');
22 $(
'#elgg-plugin-list > ul').sortable({
23 items:
'li:has(> .elgg-state-draggable)',
25 forcePlaceholderSize:
true,
29 stop:
elgg.admin.movePlugin
34 $(
".elgg-state-editable").editable(
elgg.admin.editProfileField, {
39 style:
'display:inline;' 43 $(
'#elgg-profile-fields').sortable({
45 handle:
'span.elgg-state-draggable',
46 stop:
elgg.admin.moveProfileField
50 $(
'a.elgg-admin-notice').
click(
elgg.admin.deleteNotice);
53 $(
'input:checkbox.elgg-state-disabled').live(
'click',
function() {
return false;});
56 $(
'[name=simplecache_enabled]').
click(
elgg.admin.simplecacheToggle);
66 elgg.admin.movePlugin =
function(e, ui) {
68 var pluginGuid = ui.item.attr(
'id');
69 pluginGuid = pluginGuid.replace(
'elgg-object-',
'');
71 elgg.action(
'admin/plugins/set_priority', {
73 plugin_guid: pluginGuid,
75 priority: ui.item.index() + 1
79 var priorityDep =
new RegExp(
elgg.echo(
'ElggPlugin:Dependencies:Priority'));
80 ui.item.siblings().andSelf().each(
function() {
81 if (priorityDep.test($(
this).find(
'.elgg-dependency-requires').text())) {
82 elgg.admin.updatePluginView($(
this));
95 elgg.admin.updatePluginView =
function(pluginView) {
97 var pluginGuid = pluginView.attr(
'id');
98 pluginGuid = pluginGuid.replace(
'elgg-object-',
'');
101 url:
elgg.config.wwwroot +
"ajax/view/object/plugin/full",
106 display_reordering:
true 109 if (htmlData.length > 0) {
110 pluginView.html(htmlData);
123 elgg.admin.editProfileField =
function(value,
settings) {
124 var
id = $(
this).attr(
'id');
125 id =
id.replace(
'elgg-profile-field-',
'');
132 elgg.action(
'profile/fields/edit', data);
143 elgg.admin.moveProfileField =
function(e, ui) {
144 var orderArr = $(
'#elgg-profile-fields').sortable(
'toArray');
145 var orderStr = orderArr.join(
',');
147 elgg.action(
'profile/fields/reorder', {
157 elgg.admin.deleteNotice =
function(e) {
161 elgg.action($(
this).attr(
'href'), {
163 $container.slideUp(
'medium');
173 elgg.admin.simplecacheToggle =
function() {
175 if (!$(
this).hasClass(
'elgg-state-disabled')) {
176 var names = [
'simplecache_minify_js',
'simplecache_minify_css'];
177 for (var
i = 0;
i < names.length;
i++) {
178 var
$input = $(
'input[type!=hidden][name="' + names[
i] +
'"]');
180 $input.parent().toggleClass(
'elgg-state-disabled');
186 elgg.register_hook_handler(
'init',
'system',
elgg.admin.init, 1000);
elgg message elgg state success
elgg module widget elgg state draggable elgg widget handle
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $input
function elgg combo checkbox click(function(){if($(this).is(':checked')){$(this).prev().attr('disabled', true);$(this).prev().val('');}else{$(this).prev().attr('disabled', false);}})
elgg input elgg input elgg input url