JavaScript behavior to allow shift select in grids

@param   string  $id  The id of the form for which a multiselect behaviour is to be applied.
@return  void
979170
public static function multiselect($id = 'adminForm')
	{
		if (isset(self::$loaded[__METHOD__][$id]))
		{
			return;
		}

		self::framework();

		Asset::script('assets/multiselect.js', true, true);

		// Attach multiselect to document
		App::get('document')->addScriptDeclaration(
			"jQuery(document).ready(function($){
				new Hubzero.MultiSelect('" . $id . "');
			});"
		);

		// Set static array
		self::$loaded[__METHOD__][$id] = true;
		return;
	}
680814
public function delete($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($menu->handler === 'Menu' && $this->Menus->delete($menu)) {
            $this->Flash->success(__d('menu', 'Menu has been successfully deleted!'));
        } else {
            $this->Flash->danger(__d('menu', 'Menu could not be deleted, please try again'));
        }

        $this->title(__d('menu', 'Delete Menu'));
        $this->redirect($this->referer());
    }
1210822
private function toggle($id)
    {
        $Eresus = Eresus_CMS::getLegacyKernel();

        $item = $Eresus->db->selectItem($this->table['name'], "`id`='" . $id . "'");
        $item['active'] = !$item['active'];

        $item = $Eresus->db->escape($item);
        $Eresus->db->updateItem($this->table['name'], $item, "`id`='" . $id . "'");

        HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
    }
1218891
public function setId( $id )
	{
		if ( ( $this->_values['id'] = MShop_Common_Item_Abstract::checkId($this->getId(), $id) ) === null ) {
			$this->_modified = true;
		} else {
			$this->_modified = false;
		}
	}
631266
public function edit($id)
    {
        $this->request->allowMethod(['get', 'put']);

        /** @var Page $page */
        $page = $this->Pages->get($id, ['contain' => ['Current', 'Attributes', 'Collections']]);

        ThemeManager::theme(Wasabi::setting('Cms.Theme.id'));

        if ($this->request->is('put')) {
            $page = $this->Pages->patchEntity($page, $this->request->data);
            if ($this->Pages->save($page)) {
                $this->Flash->success(__d('wasabi_cms', 'The page <strong>{0}</strong> has been saved.', $page->name));
                $this->redirect(['action' => 'index']);
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        } else {
            /** @var Content $current */
            $current = $page->current;
            if (!is_array($current) &&
                get_class($current) === 'Wasabi\Cms\Model\Entity\Content' &&
                $current->isNew()
            ) {
                $defaultLayout = ThemeManager::theme()->getLayout('Default');
                $page->current = [
                    (new Content())->set('content', json_encode($defaultLayout->content()))
                ];
            }
        }

        if ($page->meta_robots_index === null) {
            $page->meta_robots_index = (bool)Configure::read('Settings.Cms.SEO.meta-robots-index');
        }

        if ($page->meta_robots_follow === null) {
            $page->meta_robots_follow = (bool)Configure::read('Settings.Cms.SEO.meta-robots-follow');
        }

        $routes = $this->Routes
            ->findAllFor('Wasabi/Cms.Pages', $id, Wasabi::contentLanguage()->id)
            ->order([$this->Routes->aliasField('url') => 'asc']);

        $this->set([
            'page' => $page,
            'layouts' => ThemeManager::theme()->getLayoutsForSelect(),
            'availableModules' => ModuleManager::getAvailableModules(),
            'changeAttributesUrl' => Router::url([
                'plugin' => 'Wasabi/Cms',
                'controller' => 'Pages',
                'action' => 'attributes'
            ]),
            'attributes' => $page->getLayout()->attributes(),
            'routes' => $routes,
            'routeTypes' => RouteTypes::getForSelect(),
            'formRoute' => $this->Routes->newEntity([
                'type' => ($routes->count() >= 1) ? RouteTypes::TYPE_REDIRECT_ROUTE : RouteTypes::TYPE_DEFAULT_ROUTE
            ])
        ]);

        $this->render('add');
    }
704906
public function updateSelect($id = null) {
		//$this->autoRender = false;
		if (!$this->request->is('post') || !$this->request->is('ajax')) {
			throw new Exception(__('not a valid request'));
		}
		$this->viewBuilder()->layout('ajax');
		$states = $this->States->getListByCountry($id);
		$defaultFieldLabel = 'pleaseSelect';
		if ($this->request->query('optional')) {
			$defaultFieldLabel = 'doesNotMatter';
		}

		$this->set(compact('states', 'defaultFieldLabel'));
	}
929520
public function setId($id)
    {
        if (is_null($this->id) && ! is_null($id) && ($model = $this->getRepository()->find($id))) {
            $this->id = $id;

            parent::setModel($model);
            $this->getButtons()->setModel($model);
            $this->setModelClass(get_class($model));
        }
    }
1229497
public function actionEdit(int $id): void
	{
		$this->content = $this->orm->content->getById($id);
		if (!$this->content) {
			$this->error();
		}
	}
819246
protected function setIds($id)
    {
        if ($id) {
            $this->props = $this->mergeProps(array(
                $this->props,
                array(
                    'attribsContainer' => array(
                        'id' => $id.'_container',
                    ),
                    'attribs' => array(
                        'id' => $id,
                    ),
                    'attribsLabel' => array(
                        'for' => $id,
                    ),
                    'attribsHelpBlock' => array(
                        'id' => $id.'_help_block',
                    ),
                ),
            ));
        }
    }
1373954
public function updateIDValue(&$id)
    {
        $owner = $this->owner;
        if ($owner->Title) {
            $id = Convert::raw2url($owner->Title);
        }
    }
1171253
public function view($id = null) {
		$cell = $this->Cells->get($id, [
			'contain' => []
		]);
		$this->set('cell', $cell);
	}
777782
public function edit($id)
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->get($id);

        if ($this->request->data()) {
            $menu = $this->Menus->patchEntity($menu, $this->request->data(), [
                'fieldList' => [
                    'title',
                    'description',
                    'settings',
                ],
                'validate' => false
            ]);

            if ($this->Menus->save($menu, ['atomic' => true])) {
                $this->Flash->success(__d('menu', 'Menu has been saved!'));
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('menu', 'Menu could not be saved, please check your information'));
            }
        }

        $this->title(__d('menu', 'Editing Menu'));
        $this->set('menu', $menu);
        $this->Breadcrumb
            ->push('/admin/menu/manage')
            ->push(__d('menu', 'Editing menu {0}', $menu->title), '#');
    }
635105
public function setScatterSerieTicks($ID, $Width = 0)
    {
        if (isset($this->Data["ScatterSeries"][$ID])) {
            $this->Data["ScatterSeries"][$ID]["Ticks"] = $Width;
        }
    }
1249095
public function setSelected($id) {
        foreach ($this->radio_buttons as $k => $radio) {
            /* @var $radio InputRadio */
            if ((int)$k === (int)$id) {
                $radio->setSelected(true);
            } else {
                $radio->setSelected(false);
            }
        }

        return $this;
    }
516059
public function escapeCheck($id){
		$checks = $this->getEscapedChecks();
		array_push($checks, $id);
		$checks = array_unique($checks);
		$this->setEscapedChecks($checks);
	}
446438
public function generateResponsiveCss(string $id): void
  {
    if (OverviewTable::$responsiveMediaQuery===null) return;

    Abc::$assets->cssAppendLine(OverviewTable::$responsiveMediaQuery);
    Abc::$assets->cssAppendLine('{');
    $format = '#%s tr.%s > td:nth-of-type(%d):before {content: %s;}';
    $index  = 1;
    foreach ($this->slatJoints as $factory)
    {
      $text = $factory->getHeaderText();
      for ($i = 0; $i<$factory->getColSpan(); $i++)
      {
        Abc::$assets->cssAppendLine(sprintf($format, $id, OverviewTable::$class, $index, Css::txt2CssString($text)));
        $index++;
      }
    }

    Abc::$assets->cssAppendLine(sprintf($format, $id, OverviewTable::$class, $index, Css::txt2CssString('error')));

    Abc::$assets->cssAppendLine('}');
  }
668207
public function setVisible(int $id): void
    {
        $sourceNodeData = $this->locationGateway->getBasicNodeData($id);

        $this->locationGateway->setNodeWithChildrenVisible($sourceNodeData['path_string']);
    }