Beispiel #1
0
        // And we're good to go
        $importdata = (object) array('token' => '', 'usr' => $user->id, 'queue' => (int) (!PluginImport::import_immediately_allowed()), 'ready' => 0, 'expirytime' => db_format_timestamp(time() + 60 * 60 * 24), 'format' => 'leap', 'loglevel' => PluginImportLeap::LOG_LEVEL_VERBOSE, 'logtargets' => LOG_TARGET_FILE, 'profile' => true);
        $importer = PluginImport::create_importer(null, $TRANSPORTER, $importdata);
        try {
            $importer->process();
            log_info("Imported user account {$user->id} from Leap2A file, see " . $importer->get('logfile') . ' for a full log');
        } catch (ImportException $e) {
            log_info("Leap2A import failed: " . $e->getMessage());
            die_info(get_string('leap2aimportfailed', 'admin'));
        }
        // Reload the user details, as various fields are changed by the
        // importer when importing (e.g. firstname/lastname)
        $user = get_record('usr', 'id', $user->id);
    }
    db_commit();
    if (!empty($user->email)) {
        try {
            email_user($user, $USER, get_string('accountcreated', 'mahara', get_config('sitename')), get_string('accountcreatedchangepasswordtext', 'mahara', $user->firstname, get_config('sitename'), $user->username, $values['password'], get_config('wwwroot'), get_config('sitename')), get_string('accountcreatedchangepasswordhtml', 'mahara', $user->firstname, get_config('wwwroot'), get_config('sitename'), $user->username, $values['password'], get_config('wwwroot'), get_config('wwwroot'), get_config('sitename')));
        } catch (EmailException $e) {
            $SESSION->add_error_msg(get_string('newuseremailnotsent', 'admin'));
        }
    }
    $SESSION->add_ok_msg(get_string('newusercreated', 'admin'));
    redirect('/admin/users/edit.php?id=' . $user->id);
}
$smarty = smarty(array('adminadduser'));
setpageicon($smarty, 'icon-user-plus');
$smarty->assign('form', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('headingclass', 'page-header');
$smarty->display('admin/users/add.tpl');
Beispiel #2
0
function delete_success(form, data) {
    addElementClass('postdetails_' + data.id, 'hidden');
    if (\$('postfiles_' + data.id)) {
        addElementClass('postfiles_' + data.id, 'hidden');
    }
    addElementClass('postdescription_' + data.id, 'hidden');
    addElementClass('posttitle_' + data.id, 'hidden');
    var results = \$j('#blogpost_pagination div.results').html();
    var oldcount = parseInt(results, 10);
    var newcount = oldcount - 1;
    \$j('#blogpost_pagination div.results').html(results.replace(oldcount, newcount));
    progressbarUpdate('blogpost', true);
}
EOF;
$smarty = smarty(array('paginator'));
setpageicon($smarty, 'icon icon-book');
$smarty->assign('PAGEHEADING', !empty($blog) ? $blog->get('title') : $title);
if (!empty($institutionname)) {
    $smarty->assign('institution', $institutionname);
    if ($institutionname != 'mahara') {
        $smarty->assign('institutionselector', $s['institutionselector']);
        $js .= $s['institutionselectorjs'];
    }
}
$smarty->assign('INLINEJAVASCRIPT', $js);
if ($institutionname) {
    require_once get_config('libroot') . 'institution.php';
    $institution = new Institution($institutionname);
    $smarty->assign('institutiondisplayname', $institution->displayname);
} else {
    if (!$USER->get_account_preference('multipleblogs')) {
Beispiel #3
0
 *
 */
define('INTERNAL', 1);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'configusers/suspendedusers');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
define('TITLE', get_string('suspendeduserstitle', 'admin'));
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'suspendedusers');
require_once 'pieforms/pieform.php';
$type = param_alpha('type', 'suspended') == 'expired' ? 'expired' : 'suspended';
$enc_type = json_encode($type);
$typeform = pieform(array('name' => 'usertype', 'class' => 'with-heading with-label-widthauto form-condensed', 'elements' => array('type' => array('type' => 'select', 'title' => get_string('show'), 'options' => array('suspended' => get_string('suspendedusers', 'admin'), 'expired' => get_string('expiredusers', 'admin')), 'defaultvalue' => $type), 'typesubmit' => array('type' => 'submit', 'class' => 'js-hidden', 'value' => get_string('change')))));
$smarty = smarty(array('tablerenderer'));
setpageicon($smarty, 'icon-user-times');
$smarty->assign('typeform', $typeform);
$smarty->assign('INLINEJAVASCRIPT', <<<EOF
var suspendedlist = new TableRenderer(
    'suspendedlist',
    'suspended.json.php',
    [
        'name',
        function (r) {
            return TD(null, r.institutions ? map(partial(DIV, null), r.institutions) : null);
        },
        function (r) {
            return TD(null, r.institutions ? map(partial(DIV, {'class':'dont-collapse'}), r.institutionids) : r.studentid);
        },
        'cusrname',
        'reason',
Beispiel #4
0
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configsite/sitelicenses');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'licenses');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once 'license.php';
require_once 'pieforms/pieform.php';
define('TITLE', get_string('sitelicenses', 'admin'));
define('DEFAULTPAGE', 'home');
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['license_delete'])) {
        $del = array_shift(array_keys($_POST['license_delete']));
        delete_records('artefact_license', 'name', $del);
        $SESSION->add_ok_msg(get_string('licensedeleted', 'admin'));
    }
}
if (!isset($licenses)) {
    $licenses = get_records_assoc('artefact_license', null, null, 'displayname');
}
$extralicenses = get_column_sql("\n    SELECT DISTINCT license\n    FROM {artefact}\n    WHERE license IS NOT NULL AND license <> ''\n        AND license NOT IN (SELECT name FROM {artefact_license})\n    ORDER BY license\n");
$smarty = smarty();
setpageicon($smarty, 'icon-legal');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('licenses', $licenses);
$smarty->assign('extralicenses', $extralicenses);
$smarty->assign('allowextralicenses', get_config('licenseallowcustom'));
$smarty->assign('enabled', get_config('licensemetadata'));
$smarty->display('admin/site/licenses.tpl');
Beispiel #5
0
<?php

/**
 *
 * @package    mahara
 * @subpackage admin
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'adminhome/registersite');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'pieforms/pieform.php';
require get_config('libroot') . 'registration.php';
define('TITLE', get_string('Register', 'admin'));
if (!get_config('registration_lastsent')) {
    $register = register_site();
}
$smarty = smarty();
setpageicon($smarty, 'icon-star');
if (isset($register)) {
    $smarty->assign('register', $register);
}
$smarty->display('admin/registersite.tpl');
Beispiel #6
0
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configextensions/cleanurls');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once 'pieforms/pieform.php';
define('TITLE', get_string('cleanurls', 'admin'));
$regenerateform = pieform(array('name' => 'regenerateurls', 'autofocus' => false, 'class' => 'delete', 'elements' => array('regenerate' => array('type' => 'submit', 'title' => get_string('regenerateurls', 'admin'), 'description' => get_string('regenerateurlsdescription', 'admin'), 'confirm' => get_string('regenerateurlsconfirm', 'admin'), 'value' => get_string('submit')))));
$cleanurlconfigkeys = array('cleanurluserdefault', 'cleanurlgroupdefault', 'cleanurlviewdefault', 'cleanurlcharset', 'cleanurlinvalidcharacters', 'cleanurlvalidate');
foreach ($cleanurlconfigkeys as $k) {
    $cleanurlconfig[$k] = get_config($k);
}
$smarty = smarty();
setpageicon($smarty, 'icon-puzzle-piece');
$smarty->assign('cleanurls', get_config('cleanurls'));
$smarty->assign('cleanurlconfig', $cleanurlconfig);
$smarty->assign('regenerateform', $regenerateform);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('admin/extensions/cleanurls.tpl');
// Regenerates urlids for users, groups, and portfolio pages.
function regenerateurls_submit(Pieform $form, $values)
{
    global $SESSION, $USER;
    require_once 'upgrade.php';
    log_debug("Regenerating clean urls...");
    db_begin();
    // Checking duplicates one by one is too slow, so drop the index,
    // generate the urlids in big chunks, remove duplicates in one hit,
    // recreate the index.
Beispiel #7
0
    }
}
$pagination = build_pagination(array('id' => 'collectionslist_pagination', 'class' => 'center', 'url' => $baseurl, 'count' => $data->count, 'limit' => $data->limit, 'offset' => $data->offset, 'firsttext' => '', 'previoustext' => '', 'nexttext' => '', 'lasttext' => '', 'numbersincludefirstlast' => false, 'resultcounttextsingular' => get_string('collection', 'collection'), 'resultcounttextplural' => get_string('collections', 'collection')));
$smarty = smarty(array('paginator'), array(), array(), array('PAGEICON' => $pageIcon));
$urlparamsstr = '';
if ($urlparams) {
    $urlparamsstr = '&' . http_build_query($urlparams);
}
if ($canedit) {
    $smarty->assign('addonelink', get_config('wwwroot') . 'collection/edit.php?new=1' . $urlparamsstr);
}
if (!empty($institutionname) && $institutionname != 'mahara') {
    $smarty->assign('institution', $institutionname);
    $smarty->assign('institutionselector', $s['institutionselector']);
    $smarty->assign('INLINEJAVASCRIPT', $s['institutionselectorjs']);
}
if ($subsectionheading) {
    $smarty->assign('subsectionheading', $subsectionheading);
}
if (SUBTITLE) {
    $smarty->assign('PAGESUBHEADING', SUBTITLE);
}
setpageicon($smarty, $pageIcon);
$smarty->assign('canedit', $canedit);
$smarty->assign('urlparamsstr', $urlparamsstr);
$smarty->assign('collections', $data->data);
$smarty->assign('pagination', $pagination['html']);
$smarty->assign('headingclass', 'page-header');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('SUBPAGETOP', 'collection/actions.tpl');
$smarty->display('collection/index.tpl');
Beispiel #8
0
    $submitstr = get_string('next') . ': ' . get_string('editviews', 'collection');
    $confirm = null;
} else {
    $type = 'submitcancel';
    if ($new) {
        $submitstr = array('button' => get_string('next') . ': ' . get_string('editviews', 'collection'), 'cancel' => get_string('cancel'));
        $confirm = array('cancel' => get_string('confirmcancelcreatingcollection', 'collection'));
    } else {
        $submitstr = array(get_string('save'), get_string('cancel'));
        $confirm = null;
    }
}
$elements['submit'] = array('type' => $type, 'class' => 'btn-primary', 'value' => $submitstr, 'confirm' => $confirm);
$form = pieform(array('name' => 'edit', 'plugintype' => 'core', 'pluginname' => 'collection', 'successcallback' => 'submit', 'elements' => $elements));
$smarty = smarty();
setpageicon($smarty, 'icon-folder-open');
if (!empty($groupid)) {
    $smarty->assign('PAGESUBHEADING', SUBTITLE);
    $smarty->assign('PAGEHELPNAME', '0');
    $smarty->assign('SUBPAGEHELPNAME', '1');
} else {
    $smarty->assign('PAGEHEADING', SUBTITLE);
}
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('headingclass', 'page-header');
$smarty->assign_by_ref('form', $form);
$smarty->display('collection/edit.tpl');
function submit(Pieform $form, $values)
{
    global $SESSION, $new, $copy, $urlparams;
    $values['navigation'] = (int) $values['navigation'];
Beispiel #9
0
        $form->reply(PIEFORM_CANCEL, array('location' => get_config('wwwroot') . 'admin/site/networking.php'));
    }
    if (get_config('enablenetworking') != $values['enablenetworking']) {
        if (!set_config('enablenetworking', $values['enablenetworking'])) {
            networkingform_fail($form);
        } else {
            if (empty($values['enablenetworking'])) {
                $reply .= get_string('networkingdisabled', 'admin');
            } else {
                $reply .= get_string('networkingenabled', 'admin');
            }
        }
    }
    if (get_config('promiscuousmode') != $values['promiscuousmode']) {
        if (!set_config('promiscuousmode', $values['promiscuousmode'])) {
            networkingform_fail($form);
        } else {
            if (empty($values['promiscuousmode'])) {
                $reply .= get_string('promiscuousmodedisabled', 'admin');
            } else {
                $reply .= get_string('promiscuousmodeenabled', 'admin');
            }
        }
    }
    $form->reply(PIEFORM_OK, array('message' => $reply == '' ? get_string('networkingunchanged', 'admin') : $reply, 'goto' => '/admin/site/networking.php'));
}
$smarty = smarty();
setpageicon($smarty, 'icon-exchange');
$smarty->assign('networkingform', $networkingform);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('admin/site/networking.tpl');
Beispiel #10
0
}
$pageoptions = array();
foreach ($sitepages as $page) {
    $section = in_array($page->name, $localpagenames) ? 'local' : 'admin';
    $pageoptions[$page->name] = get_string($page->name, $section);
    $pagecontents[$page->name] = $page->content;
}
asort($pageoptions);
$getstring = array('discardpageedits' => json_encode(get_string('discardpageedits', 'admin')));
$form = pieform(array('name' => 'editsitepage', 'jsform' => true, 'jssuccesscallback' => 'contentSaved', 'elements' => array('pageinstitution' => array('type' => 'hidden', 'value' => 'mahara'), 'pagename' => array('type' => 'select', 'title' => get_string('pagename', 'admin'), 'defaultvalue' => DEFAULTPAGE, 'options' => $pageoptions), 'pagetext' => array('name' => 'pagetext', 'type' => 'wysiwyg', 'rows' => 25, 'cols' => 100, 'title' => get_string('pagetext', 'admin'), 'defaultvalue' => $pagecontents[DEFAULTPAGE], 'rules' => array('maxlength' => 65536, 'required' => true)), 'submit' => array('class' => 'btn-success', 'type' => 'submit', 'value' => get_string('savechanges', 'admin')))));
function editsitepage_submit(Pieform $form, $values)
{
    global $USER;
    $data = new StdClass();
    $data->name = $values['pagename'];
    $data->content = $values['pagetext'];
    $data->mtime = db_format_timestamp(time());
    $data->mauthor = $USER->get('id');
    $data->institution = 'mahara';
    try {
        update_record('site_content', $data, array('name', 'institution'));
    } catch (SQLException $e) {
        $form->reply(PIEFORM_ERR, get_string('savefailed', 'admin'));
    }
    $form->reply(PIEFORM_OK, get_string('pagesaved', 'admin'));
}
$smarty = smarty(array('adminsitepages'), array(), array('admin' => array('discardpageedits')));
setpageicon($smarty, 'icon-pencil');
$smarty->assign('pageeditform', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('admin/site/pages.tpl');
Beispiel #11
0
    p = {$pagination['javascript']}
EOF;
if ($offset > 0) {
    $js .= <<<EOF
    if (\$('myviews')) {
        getFirstElementByTagAndClassName('a', null, 'myviews'). focus();
    }
EOF;
} else {
    $js .= <<<EOF
    if (\$('searchresultsheading')) {
        addElementClass('searchresultsheading', 'hidefocus');
        setNodeAttribute('searchresultsheading', 'tabIndex', -1);
        \$('searchresultsheading').focus();
    }
EOF;
}
$js .= '});';
$createviewform = pieform(create_view_form(null, 'mahara'));
$smarty = smarty(array('paginator'));
setpageicon($smarty, 'icon-file-text');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('views', $views);
$smarty->assign('institution', 'mahara');
$smarty->assign('pagination', $pagination['html']);
$smarty->assign('query', param_variable('query', null));
$smarty->assign('querystring', get_querystring());
$smarty->assign('searchform', $searchform);
$smarty->assign('createviewform', $createviewform);
$smarty->display('view/index.tpl');
Beispiel #12
0
        break;
    case 'historical':
        $data = historical_statistics($limit, $offset, $field);
        break;
    case 'content':
        $data = content_statistics($limit, $offset);
        break;
    case 'groups':
        $data = group_statistics($limit, $offset);
        break;
    case 'views':
        $data = view_statistics($limit, $offset);
        break;
    case 'users':
    default:
        $data = user_statistics($limit, $offset, $sitedata);
}
$js = <<<EOF
addLoadEvent(function () {
    {$data['table']['pagination_js']}
});
EOF;
$smarty = smarty(array('paginator', 'js/chartjs/Chart.min.js'));
setpageicon($smarty, 'icon-area-chart');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('sitedata', $sitedata);
$smarty->assign('type', $type);
$smarty->assign('subpages', $subpages);
$smarty->assign('subpagedata', $data);
$smarty->display('admin/statistics.tpl');
Beispiel #13
0
<?php

/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configsite/share');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once get_config('libroot') . 'view.php';
define('TITLE', get_string('share', 'view'));
$accesslists = View::get_accesslists(null, null, 'mahara');
$smarty = smarty();
setpageicon($smarty, 'icon-key');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('accesslists', $accesslists);
$smarty->display('view/share.tpl');
Beispiel #14
0
        sendjsonrequest('deletegroupcategory.json.php',{'itemid':itemid}, 'POST', getitems);
    }
}

// Send the menu item in the form to the database.
function saveitem(itemid) {
    var f = \$('form');
    var name = \$('name'+itemid).value;
    if (name == '') {
        displayMessage(get_string('namedfieldempty',{$getstring['name']}),'error');
        return false;
    }

    var data = {'name':name,
                'itemid':itemid};
    sendjsonrequest('updategroup.json.php', data, 'POST', function(r) {
        getitems(r);
    });
    return false;
}

addLoadEvent(function () {
    getitems();
});
EOJS;
$smarty = smarty();
setpageicon($smarty, 'icon-users');
$smarty->assign('PAGEHEADING', hsc(get_string('groupcategories', 'admin')));
$smarty->assign('INLINEJAVASCRIPT', $ijs);
$smarty->assign('optionform', $optionform);
$smarty->display('admin/groups/groupcategories.tpl');
Beispiel #15
0
    $enabled = $values['enabled'];
    set_config('cookieconsent_enabled', $enabled);
    // Remove unused values and save Cookie Consent settings
    unset($values['enabled']);
    unset($values['submit']);
    unset($values['sesskey']);
    // Disabled checkbox isn't send through HTTP POST request, so
    $values['cookietypes'] = array_merge($values['cookietypes'], array('necessary'));
    // Save Cookie Consent plugin settings
    set_config('cookieconsent_settings', serialize($values));
    // Redirect to further installation instructions
    if ($enabled) {
        $SESSION->add_ok_msg(get_string('cookieconsentenabled', 'cookieconsent'));
        redirect(get_config('wwwroot') . 'admin/site/cookieconsent2.php');
    } else {
        $SESSION->add_ok_msg(get_string('cookieconsentdisabled', 'cookieconsent'));
        redirect(get_config('wwwroot') . 'admin/index.php');
    }
}
$smarty = smarty();
setpageicon($smarty, 'icon-shield');
$smarty->assign('form', $form);
$smarty->assign('introtext1', get_string('cookieconsentintro1', 'cookieconsent'));
$smarty->assign('introtext2', get_string('cookieconsentintro2', 'cookieconsent'));
$smarty->assign('introtext3', get_string('cookieconsentintro3', 'cookieconsent'));
$smarty->assign('introtext4', get_string('cookieconsentintro4', 'cookieconsent'));
$smarty->assign('introtext5', get_string('cookieconsentintro51', 'cookieconsent', '<a href="http://sitebeam.net/cookieconsent/" target="_blank">', '</a>'));
// Official EU languages
$smarty->assign('languages', array('BG', 'CS', 'DA', 'DE', 'EL', 'EN', 'ES', 'ET', 'FI', 'FR', 'HU', 'IT', 'LT', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SL', 'SV'));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('admin/site/cookieconsent.tpl');
Beispiel #16
0
define('INTERNAL', 1);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'manageinstitutions/institutionfiles');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'file');
define('SECTION_PAGE', 'institutionfiles');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
safe_require('artefact', 'file');
require_once get_config('libroot') . 'institution.php';
$institution = param_alphanum('institution', false);
define('TITLE', get_string('institutionfiles', 'admin'));
$s = institution_selector_for_page($institution, get_config('wwwroot') . 'artefact/file/institutionfiles.php');
$institution = $s['institution'];
$pagebase = get_config('wwwroot') . 'artefact/file/institutionfiles.php?institution=' . $institution;
$form = pieform(ArtefactTypeFileBase::files_form($pagebase, null, $institution));
$js = ArtefactTypeFileBase::files_js();
$smarty = smarty();
setpageicon($smarty, 'icon-university');
if ($institution === false) {
    $smarty->display('admin/users/noinstitutions.tpl');
    exit;
}
if (!$USER->can_edit_institution($institution)) {
    throw new AccessDeniedException();
}
$smarty->assign('institution', $institution);
$smarty->assign('institutionselector', $s['institutionselector']);
$smarty->assign('form', $form);
$smarty->assign('INLINEJAVASCRIPT', $s['institutionselectorjs'] . $js);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('artefact:file:files.tpl');
Beispiel #17
0
        }
        else {
            // enable the radio buttons
            overrideuseraccountlifetime.attr('disabled',false);
            if (!j('#siteoptions input[name=defaultaccountlifetimeupdate]:checked').val()) {
                overrideuseraccountlifetime.each(function() {
                    if (typeof j(this).attr('checked') === 'undefined' || j(this).attr('checked') === false) {
                        // if no radio button already selected then choose the 'only for new users' option by default
                        if (j(this).val() == 'none') {
                            j(this).attr('checked',true);
                        }
                    }
                });
            }
        }
    }
    // when default account lifetime changes rerun the override account lifetime checks
    defaultaccountlifetime.change(function() {
        overrideuseraccountlife(defaultaccountlifetime.val());
    });
    // initial setup
    overrideuseraccountlife(defaultaccountlifetime.val());
});
EOF;
$thispage = json_encode(get_config('wwwroot') . 'admin/site/options.php');
$smarty = smarty(array('adminsiteoptions'));
setpageicon($smarty, 'icon-cogs');
$smarty->assign('siteoptionform', $siteoptionform);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->display('admin/site/options.tpl');
Beispiel #18
0
    $new = array();
    $newurls = array();
    foreach (array_keys($all) as $k) {
        if (!empty($values[$k])) {
            $new[] = $k;
        }
        if (!empty($values[$k . '_link']) && $values[$k . '_link'] != $all[$k]['url']) {
            $newurls[$k] = $values[$k . '_link'];
        }
    }
    if ($new != $active) {
        set_config('footerlinks', serialize($new));
        $SESSION->add_ok_msg(get_string('footerupdated', 'admin'));
    }
    if ($newurls != $activeurls) {
        set_config('footercustomlinks', serialize($newurls));
        if ($new == $active) {
            // record message in session only if we haven't done so yet.
            $SESSION->add_ok_msg(get_string('footerupdated', 'admin'));
        }
    }
    redirect(get_config('wwwroot') . 'admin/site/menu.php');
}
$smarty = smarty();
setpageicon($smarty, 'icon-bars');
$smarty->assign('INLINEJAVASCRIPT', $ijs);
$smarty->assign('MENUS', $menulist);
$smarty->assign('descriptionstrargs', array('<a href="' . get_config('wwwroot') . 'artefact/file/sitefiles.php">', '</a>'));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('footerform', $footerform);
$smarty->display('admin/site/menu.tpl');
Beispiel #19
0
<?php

/**
 *
 * @package    mahara
 * @subpackage artefact-file
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configsite/sitefiles');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'file');
define('SECTION_PAGE', 'sitefiles');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
safe_require('artefact', 'file');
define('TITLE', get_string('sitefiles', 'admin'));
$form = pieform(ArtefactTypeFileBase::files_form(get_config('wwwroot') . 'artefact/file/sitefiles.php', null, 'mahara'));
$js = ArtefactTypeFileBase::files_js();
$smarty = smarty();
setpageicon($smarty, 'icon-file-image-o');
$smarty->assign('descriptionstrargs', array('<a href="' . get_config('wwwroot') . 'admin/site/menu.php">', '</a>'));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('institution', 'mahara');
$smarty->assign('form', $form);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->display('artefact:file:files.tpl');