2006-03-06 19:27:25 +00:00
|
|
|
<?PHP // $Id$
|
2007-08-17 07:25:47 +00:00
|
|
|
|
2006-03-06 19:27:25 +00:00
|
|
|
require_once('../config.php');
|
2005-10-16 22:34:25 +00:00
|
|
|
require_once($CFG->dirroot.'/lib/pagelib.php');
|
2007-08-17 07:25:47 +00:00
|
|
|
|
2006-03-06 19:27:25 +00:00
|
|
|
$pt = optional_param('pt', null, PARAM_SAFEDIR); //alhanumeric and -
|
2005-10-16 22:34:25 +00:00
|
|
|
|
2009-05-06 09:23:37 +00:00
|
|
|
$pagetypes = array('my-index' => array('id' => 'my-index',
|
|
|
|
'lib' => '/lib/pagelib.php',
|
2006-09-03 14:45:57 +00:00
|
|
|
'name' => get_string('mymoodle','admin')),
|
2007-08-17 07:25:47 +00:00
|
|
|
PAGE_COURSE_VIEW => array('id' => PAGE_COURSE_VIEW,
|
2005-10-16 22:34:25 +00:00
|
|
|
'lib' => '/lib/pagelib.php',
|
|
|
|
'name' => get_string('stickyblockscourseview','admin'))
|
|
|
|
// ... more?
|
|
|
|
);
|
|
|
|
|
|
|
|
// for choose_from_menu
|
|
|
|
$options = array();
|
|
|
|
foreach ($pagetypes as $p) {
|
|
|
|
$options[$p['id']] = $p['name'];
|
|
|
|
}
|
|
|
|
|
|
|
|
require_login();
|
2007-08-17 07:25:47 +00:00
|
|
|
|
2008-05-02 04:37:02 +00:00
|
|
|
require_capability('moodle/site:manageblocks', get_context_instance(CONTEXT_SYSTEM));
|
2005-10-16 22:34:25 +00:00
|
|
|
|
|
|
|
// first thing to do is print the dropdown menu
|
|
|
|
|
|
|
|
$strtitle = get_string('stickyblocks','admin');
|
|
|
|
$strheading = get_string('adminhelpstickyblocks');
|
2007-08-17 07:25:47 +00:00
|
|
|
|
|
|
|
|
2005-10-16 22:34:25 +00:00
|
|
|
|
|
|
|
if (!empty($pt)) {
|
2006-10-02 06:58:46 +00:00
|
|
|
|
2005-10-16 22:34:25 +00:00
|
|
|
require_once($CFG->dirroot.$pagetypes[$pt]['lib']);
|
2007-08-17 07:25:47 +00:00
|
|
|
|
2005-10-16 22:34:25 +00:00
|
|
|
define('ADMIN_STICKYBLOCKS',$pt);
|
2007-08-17 07:25:47 +00:00
|
|
|
|
2006-10-08 08:44:32 +00:00
|
|
|
$PAGE = page_create_object($pt, SITEID);
|
2009-05-06 08:38:55 +00:00
|
|
|
$blocks = blocks_setup($PAGE, BLOCKS_PINNED_TRUE);
|
2005-10-16 22:34:25 +00:00
|
|
|
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($blocks[BLOCK_POS_LEFT]), 210);
|
2006-10-08 08:36:45 +00:00
|
|
|
|
2007-08-17 07:25:47 +00:00
|
|
|
$navlinks = array(array('name' => get_string('administration'),
|
|
|
|
'link' => "$CFG->wwwroot/$CFG->admin/index.php",
|
|
|
|
'type' => 'misc'));
|
|
|
|
$navlinks[] = array('name' => $strtitle, 'link' => null, 'type' => 'misc');
|
|
|
|
$navigation = build_navigation($navlinks);
|
|
|
|
print_header($strtitle,$strtitle,$navigation);
|
|
|
|
|
2006-10-08 08:36:45 +00:00
|
|
|
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
|
|
|
|
echo '<tr valign="top">';
|
|
|
|
|
2006-09-25 14:40:26 +00:00
|
|
|
echo '<td valign="top" style="width: '.$blocks_preferred_width.'px;" id="left-column">';
|
2007-11-23 16:49:51 +00:00
|
|
|
print_container_start();
|
2005-10-16 22:34:25 +00:00
|
|
|
blocks_print_group($PAGE, $blocks, BLOCK_POS_LEFT);
|
2007-11-23 16:49:51 +00:00
|
|
|
print_container_end();
|
2006-10-02 06:58:46 +00:00
|
|
|
echo '</td>';
|
|
|
|
echo '<td valign="top" id="middle-column">';
|
2007-11-23 16:49:51 +00:00
|
|
|
print_container_start();
|
2007-08-17 07:25:47 +00:00
|
|
|
|
2005-10-16 22:34:25 +00:00
|
|
|
} else {
|
2006-10-02 06:58:46 +00:00
|
|
|
require_once($CFG->libdir.'/adminlib.php');
|
2007-04-30 17:08:34 +00:00
|
|
|
admin_externalpage_setup('stickyblocks');
|
|
|
|
admin_externalpage_print_header();
|
2005-10-16 22:34:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-11 08:31:58 +00:00
|
|
|
print_box_start();
|
2005-10-16 22:34:25 +00:00
|
|
|
print_heading($strheading);
|
2007-01-11 08:33:51 +00:00
|
|
|
popup_form("$CFG->wwwroot/$CFG->admin/stickyblocks.php?pt=", $options, 'selecttype', $pt, 'choose', '', '', false, 'self', get_string('stickyblockspagetype','admin').': ');
|
2006-11-20 09:02:41 +00:00
|
|
|
echo '<p>'.get_string('stickyblocksduplicatenotice','admin').'</p>';
|
2007-01-11 08:31:58 +00:00
|
|
|
print_box_end();
|
2005-10-16 22:34:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!empty($pt)) {
|
2007-11-23 16:49:51 +00:00
|
|
|
print_container_end();
|
2006-10-02 06:58:46 +00:00
|
|
|
echo '</td>';
|
2007-08-31 19:05:26 +00:00
|
|
|
echo '<td valign="top" style="width: '.$blocks_preferred_width.'px;" id="right-column">';
|
2007-11-23 16:49:51 +00:00
|
|
|
print_container_start();
|
2005-10-16 22:34:25 +00:00
|
|
|
blocks_print_group($PAGE, $blocks, BLOCK_POS_RIGHT);
|
2007-11-23 16:49:51 +00:00
|
|
|
print_container_end();
|
2006-10-02 06:58:46 +00:00
|
|
|
echo '</td>';
|
|
|
|
echo '</tr></table>';
|
|
|
|
print_footer();
|
|
|
|
} else {
|
2007-04-30 17:08:34 +00:00
|
|
|
admin_externalpage_print_footer();
|
2005-10-16 22:34:25 +00:00
|
|
|
}
|
|
|
|
|
2006-09-03 14:45:57 +00:00
|
|
|
?>
|