示例#1
0
suspendedlist.updateOnLoad();

addLoadEvent(function() {
    connect('usertype_type', 'onchange', function() {
        if (suspendedlist.type != \$('usertype_type').value) {
            suspendedlist.offset = 0;
            suspendedlist.type = \$('usertype_type').value;
            suspendedlist.doupdate();
        }
    });
});

EOF
);
$form = new Pieform(array('name' => 'buttons', 'renderer' => 'div', 'autofocus' => false, 'elements' => array('buttons' => array('type' => 'fieldset', 'class' => 'btn-group pull-right', 'isformgroup' => false, 'elements' => array('unsuspend' => array('class' => 'btn-default text-inline', 'type' => 'submit', 'isformgroup' => false, 'renderelementsonly' => true, 'name' => 'unsuspend', 'value' => get_string('unsuspendusers', 'admin')), 'unexpire' => array('class' => 'btn-default text-inline', 'type' => 'submit', 'isformgroup' => false, 'renderelementsonly' => true, 'name' => 'unexpire', 'value' => get_string('unexpireusers', 'admin')), 'delete' => array('class' => 'btn-default text-inline', 'type' => 'submit', 'isformgroup' => false, 'renderelementsonly' => true, 'confirm' => get_string('confirmdeleteusers', 'admin'), 'name' => 'delete', 'value' => get_string('deleteusers', 'admin')))))));
$smarty->assign('buttonformopen', $form->get_form_tag());
$smarty->assign('buttonform', $form->build(false));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('admin/users/suspended.tpl');
function buttons_submit_unsuspend(Pieform $form, $values)
{
    global $SESSION;
    $ids = get_user_ids_from_post();
    foreach ($ids as $userid) {
        unsuspend_user($userid);
    }
    $SESSION->add_ok_msg(get_string('usersunsuspendedsuccessfully', 'admin'));
    redirect('/admin/users/suspended.php');
}
function buttons_submit_unexpire(Pieform $form, $values)
{
示例#2
0
            // Just to be sure
            if ($iconartefact->get('artefacttype') == 'profileicon' && $iconartefact->get('owner') == $USER->get('id')) {
                // Remove the skin background and update the skin thumbs
                require_once get_config('libroot') . 'skin.php';
                Skin::remove_background($iconartefact->get('id'));
                $iconartefact->delete();
            } else {
                throw new AccessDeniedException();
            }
        }
        if (in_array($USER->get('profileicon'), $icons)) {
            $USER->profileicon = null;
            $USER->commit();
        }
        db_commit();
        $SESSION->add_ok_msg(get_string('filethingdeleted', 'artefact.file', get_string('nprofilepictures', 'artefact.file', count($icons))));
    } else {
        $SESSION->add_info_msg(get_string('profileiconsnoneselected', 'artefact.file'));
    }
    redirect('/artefact/file/profileicons.php');
}
$smarty = smarty(array('tablerenderer'), array(), array(), array('sideblocks' => array(array('name' => 'quota', 'weight' => -10, 'data' => array()))));
$smarty->assign('INLINEJAVASCRIPT', $IJS);
$smarty->assign('uploadform', $uploadform);
// This is a rare case where we don't actually care about the form, because
// it only contains submit buttons (which we can just write as HTML), and
// the buttons need to be inside the tablerenderer.
$smarty->assign('settingsformtag', $settingsform->get_form_tag());
$smarty->assign('imagemaxdimensions', array(get_config('imagemaxwidth'), get_config('imagemaxheight')));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('artefact:file:profileicons.tpl');