Commit 90fe4ee4 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1952143: Removing obsolete category button renderer



We still keep the template as that is used to create the
'add placeholder block' button

Change-Id: Ia3f663c47870c9348f12de10c6b4666258df29f7
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent c44a74c3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -170,3 +170,4 @@ $string['fileuploadtoomany'] = 'You are trying to upload too many files. You can
$string['sideblockmenuclash'] = 'The sideblock name "%s" is already in use. Please choose a different one.';
$string['isolatedinstitutionsremoverules'] = 'We have hidden %s access rules due to isolated institutions being in effect. The hidden rules will be removed once the form is saved.';
$string['randomkeyminlength'] = 'Length must be a positive integer equal to or greater than 8';
$string['noviewcontrolaction'] = 'Unknown edit action: %s';
+0 −23
Original line number Diff line number Diff line
@@ -2021,29 +2021,6 @@ class View {
        return $this->categorydata = $categories;
    }

    /**
     * Returns HTML for the blocktype list for a particular category
     *
     * @param string $category   The category to build the blocktype list for
     * @param bool   $javascript Set to true if the caller is a json script,
     *                           meaning that nothing for the standard HTML version
     *                           alone should be output
     */
    public function build_blocktype_list($category, $javascript=false) {
        require_once(get_config('docroot') . 'blocktype/lib.php');
        $blocktypes = PluginBlocktype::get_blocktypes_for_category($category, $this);
        $smarty = smarty_core();
        $smarty->assign('blocktypes', $blocktypes);
        $smarty->assign('javascript', $javascript);
        $smarty->assign('accessible', $this->get('accessibleview'));
        $smarty->assign('GS_DESKTOP_WIDTH', BlockInstance::GRIDSTACK_CONSTANTS['desktopWidth']);
        $smarty->assign('GS_DEFAULT_HEIGHT', BlockInstance::GRIDSTACK_CONSTANTS['defaultHeight']);
        $smarty->assign('GS_DRAG_HEIGHT', BlockInstance::GRIDSTACK_CONSTANTS['dragHeight']);
        $smarty->assign('GS_DRAG_WIDTH', BlockInstance::GRIDSTACK_CONSTANTS['dragWidth']);

        return $smarty->fetch('view/blocktypelist.tpl');
    }

    /**
     * Process view changes. This function is used both by the json stuff and
     * by normal posts
+0 −8
Original line number Diff line number Diff line
@@ -35,13 +35,5 @@ if ($change) {
        json_reply(true, array('message' => $e->getMessage(), 'placement' => 'placeholderlist'));
    }
}
// else we're just reading data...
switch ($action) {
case 'blocktype_list':
    $category = param_alpha('c');
    $data = $view->build_blocktype_list($category, true);
    json_reply(false, array('message' => false, 'data' => $data));
    break;
}

json_reply(true, get_string('noviewcontrolaction', 'error', $action));