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, label.elgg-state-disabled > input:checkbox')
54 .live(
'click',
function() {
return false;});
57 $(
'[name=simplecache_enabled]').
click(
elgg.admin.simplecacheToggle);
67 elgg.admin.movePlugin =
function(e, ui) {
69 var pluginGuid = ui.item.attr(
'id');
70 pluginGuid = pluginGuid.replace(
'elgg-object-',
'');
72 elgg.action(
'admin/plugins/set_priority', {
74 plugin_guid: pluginGuid,
76 priority: ui.item.index() + 1
80 var priorityDep =
new RegExp(
elgg.echo(
'ElggPlugin:Dependencies:Priority'));
81 ui.item.siblings().andSelf().each(
function() {
82 if (priorityDep.test($(
this).find(
'.elgg-dependency-requires').text())) {
83 elgg.admin.updatePluginView($(
this));
96 elgg.admin.updatePluginView =
function(pluginView) {
98 var pluginGuid = pluginView.attr(
'id');
99 pluginGuid = pluginGuid.replace(
'elgg-object-',
'');
102 url:
elgg.config.wwwroot +
"ajax/view/object/plugin/full",
107 display_reordering:
true 110 if (htmlData.length > 0) {
111 pluginView.html(htmlData);
124 elgg.admin.editProfileField =
function(value,
settings) {
125 var
id = $(
this).attr(
'id');
126 id =
id.replace(
'elgg-profile-field-',
'');
133 elgg.action(
'profile/fields/edit', data);
144 elgg.admin.moveProfileField =
function(e, ui) {
145 var orderArr = $(
'#elgg-profile-fields').sortable(
'toArray');
146 var orderStr = orderArr.join(
',');
148 elgg.action(
'profile/fields/reorder', {
158 elgg.admin.deleteNotice =
function(e) {
162 elgg.action($(
this).attr(
'href'), {
164 $container.slideUp(
'medium');
174 elgg.admin.simplecacheToggle =
function() {
176 if (!$(
this).hasClass(
'elgg-state-disabled')) {
177 var names = [
'simplecache_minify_js',
'simplecache_minify_css'];
178 for (var
i = 0;
i < names.length;
i++) {
179 var
$input = $(
'input[type!=hidden][name="' + names[
i] +
'"]');
181 $input.parent().toggleClass(
'elgg-state-disabled');
187 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