/** * Rebuild our position selects * * @return void * @access public * @since 5/16/06 */ function rebuildPositionSelects() { // Populate our position list; $positionList = new WSelectList(); $js = ' var choiceName = this.name + \'Choice\'; for (var i = 0; i < this.form.elements.length; i++) { if (this.form.elements[i].name == choiceName) { this.form.elements[i].value = \'true\'; break; } } submitWizard(this.form); '; $positionList->addOnChange(preg_replace("/\\s{2,}/", " ", preg_replace("/[\n\r\t]/", " ", $js))); $i = 0; $this->_orderedSet->reset(); while ($this->_orderedSet->hasNext()) { $this->_orderedSet->next(); $positionList->addOption($i, $i + 1); $i++; } // Enabled State $positionList->setEnabled($this->_enabled, $this->_enabledSticky); // Rebuild the position lists. $this->_orderedSet->reset(); while ($this->_orderedSet->hasNext()) { $collectionId = $this->_orderedSet->next(); $key = $collectionId->getIdString(); $this->_collections[$key]["_moveToPosition"] = $positionList->deepCopy(); $this->_collections[$key]["_moveToPosition"]->setParent($this); $this->_collections[$key]["_moveToPosition"]->setValue(strval($this->_orderedSet->getPosition($collectionId))); $this->_collections[$key]["_moveToPositionChoice"] = WHiddenField::withValue('false'); $this->_collections[$key]["_moveToPositionChoice"]->setParent($this); } }