$smarty = smarty(array(), $stylesheets, false, $extraconfig); $smarty->assign('maintitle', TITLE); $smarty->assign('formurl', get_config('wwwroot') . 'view/blocks.php'); $smarty->assign('view', $view->get('id')); $smarty->assign('viewtitle', $view->get('title')); $smarty->assign('viewtheme', $viewtheme); $smarty->assign('viewthemes', $allowedthemes); $smarty->display('view/changetheme.tpl'); exit; } $javascript = array('views', 'tinymce', 'paginator', 'js/jquery/jquery-ui/js/jquery-ui.min.js', 'js/jquery/jquery-ui/js/jquery-ui.touch-punch.min.js', 'tablerenderer', 'artefact/file/js/filebrowser.js', 'lib/pieforms/static/core/pieforms.js', 'js/jquery/modernizr.custom.js'); $blocktype_js = $view->get_all_blocktype_javascript(); $javascript = array_merge($javascript, $blocktype_js['jsfiles']); $inlinejs = "addLoadEvent( function() {\n" . join("\n", $blocktype_js['initjs']) . "\n});"; require_once 'pieforms/pieform/elements/select.php'; $inlinejs .= pieform_element_select_get_inlinejs(); // The form for adding blocks via the keyboard $addform = pieform(array('name' => 'addblock', 'method' => 'post', 'jsform' => true, 'renderer' => 'div', 'autofocus' => false, 'class' => 'cell-radios', 'elements' => array('cellchooser' => array('type' => 'radio', 'class' => 'fullwidth', 'title' => get_string('blockcell', 'view'), 'rowsize' => 2, 'options' => array('R1C1', 'R1C2', 'R2C1')), 'position' => array('type' => 'select', 'title' => get_string('blockorder', 'view'), 'options' => array('Top', 'After 1', 'After 2')), 'submit' => array('type' => 'submitcancel', 'class' => 'btn-default', 'value' => array(get_string('add'), get_string('cancel')))))); $blockid = $view->get_blockinstance_currently_being_configured(); if (!$blockid) { $blockid = param_integer('block', 0); if (!$blockid) { // Build content before initialising smarty in case pieform elements define headers. $viewcontent = $view->build_rows(true); } } $smarty = smarty($javascript, $stylesheets, array('view' => array('addblock', 'cellposition', 'blockordertopcell', 'blockorderafter', 'moveblock')), $extraconfig); $smarty->assign('addform', $addform); // The list of categories for the tabbed interface $smarty->assign('category_list', $view->build_category_list($category, $new)); // The list of shortcut blocks
function pieform_element_select_get_headdata() { $result = '<script type="application/javascript">' . "\n"; $result .= pieform_element_select_get_inlinejs(); $result .= '</script>' . "\n"; return array($result); }