function SlideOrderedRepeatableComponentCollection() { parent::WOrderedRepeatableComponentCollection(); $this->_addButton->setLabel(_("Add a Text-Slide")); $this->_addFromBasketButton = WEventButton::withLabel(dgettext("polyphony", "Create Slides from Selection")); $this->_addFromBasketButton->setParent($this); }
/** * Tells the wizard component to update itself - this may include getting * form post data or validation - whatever this particular component wants to * do every pageload. * @param string $fieldName The field name to use when outputting form data or * similar parameters/information. * @access public * @return boolean - TRUE if everything is OK */ function update($fieldName) { parent::update($fieldName); if ($this->getAllValues()) { $this->_stepContainer->nextStep(); } }
/** * Tells the wizard component to update itself - this may include getting * form post data or validation - whatever this particular component wants to * do every pageload. * @param string $fieldName The field name to use when outputting form data or * similar parameters/information. * @access public * @return boolean - TRUE if everything is OK */ function update($fieldName) { parent::update($fieldName); if ($this->getAllValues()) { // go back! $this->_stepContainer->goBack(); } }
/** * Tells the wizard component to update itself - this may include getting * form post data or validation - whatever this particular component wants to * do every pageload. * @param string $fieldName The field name to use when outputting form data or * similar parameters/information. * @access public * @return boolean - TRUE if everything is OK */ function update($fieldName) { parent::update($fieldName); if ($this->getAllValues()) { // advance the step! $this->_stepContainer->previousStep(); } }
/** * Tells the wizard component to update itself - this may include getting * form post data or validation - whatever this particular component wants to * do every pageload. * @param string $fieldName The field name to use when outputting form data or * similar parameters/information. * @access public * @return boolean - TRUE if everything is OK */ function update($fieldName) { parent::update($fieldName); $wizard = $this->getWizard(); if ($this->getAllValues()) { // go forward! $this->_stepContainer->goForward(); } }
function __construct($label = null) { parent::__construct(); if (is_null($label)) { $label = dgettext("polyphony", "Cancel"); } $this->setEventAndLabel("edu.middlebury.polyphony.wizard.cancel", $label); $this->addOnClick("ignoreValidation(this.form);"); }
function WAgentBrowser() { $this->_searchField = new WTextField(); $this->_searchField->setSize(20); $this->_searchButton = WEventButton::withLabel(dgettext("polyphony", "Go")); $agentManager = Services::getService("Agent"); $searchTypes = $agentManager->getAgentSearchTypes(); $this->_searchTypeSelector = new WSelectList(); $count = 0; while ($searchTypes->hasNext()) { $type = $searchTypes->next(); $this->_searchTypeSelector->addOption(urlencode($type->asString()), $type->asString()); $this->_searchTypeSelector->setValue(urlencode($type->asString())); $count++; } if ($count < 2) { $this->_oneType = true; } $this->_searchField->setParent($this); $this->_searchButton->setParent($this); $this->_searchTypeSelector->setParent($this); }
/** * Adds a new element to the end of the list. * @param boolean $removable Can this collection be removed by the user? * @access private * @return void */ function &_addElement($removable = true) { if ($this->_max != -1 && $this->_num == $this->_max - 1) { return; } // clone our base set (the getChildren() array) $newArray = array(); $base = $this->getChildren(); foreach (array_keys($base) as $key) { $newArray[$key] = $base[$key]->copy(); $newArray[$key]->setParent($this); } $newArray["_remove"] = WEventButton::withLabel($this->_removeLabel); $newArray["_remove"]->setParent($this); $newArray["_remove"]->addOnClick("ignoreValidation(this.form);"); $newArray["_remove"]->setEnabled($removable, !$removable); $this->_collections[$this->_nextId] =& $newArray; $idManager = Services::getService("Id"); $this->_orderedSet->addItem($idManager->getId(strval($this->_nextId))); $this->_nextId++; $this->_num++; $this->rebuildPositionSelects(); return $newArray; }
/** * Answer the markup for a set of search results * * @param string $fieldName * @param array $results An array of WSearchResult objects * @return string * @access public * @since 11/27/07 */ public function getResultsMarkup($fieldName, $results) { $harmoni = Harmoni::instance(); if (count($results)) { print "\n\t<table id='" . RequestContext::name($fieldName) . "_output' class='search_results' cellspacing='0'>"; $colorKey = 0; foreach ($results as $result) { print "\n\t\t<tr class='search_result_item '>"; print "\n\t\t\t<td class='color" . $colorKey . "'>"; print $result->getMarkup(); print "\n\t\t\t</td>"; print "\n\t\t\t<td class='action_button color" . $colorKey . "'>"; // Create a button for each result. if (!isset($this->buttons[$result->getIdString()])) { $this->buttons[$result->getIdString()] = WEventButton::withLabel('+'); $this->buttons[$result->getIdString()]->setParent($this->parent); } print $this->buttons[$result->getIdString()]->getMarkup($fieldName . '_' . $this->getKey($result->getIdString())); print "\n\t\t\t</td>"; print "\n\t\t</tr>"; $colorKey = intval(!$colorKey); } print "\n\t</table>"; } }
/** * Adds a new element to the end of the list. * @param boolean $removable Can this collection be removed by the user? * @access private * @return void */ function &_addElement($removable = true) { if ($this->_max != -1 && $this->_num == $this->_max - 1) { return; } // clone our base set (the getChildren() array) $newArray = array(); $base = $this->getChildren(); foreach (array_keys($base) as $key) { $newArray[$key] = $base[$key]->copy(); $newArray[$key]->setParent($this); } $newArray["_remove"] = WEventButton::withLabel($this->_removeLabel); $newArray["_remove"]->setParent($this); $newArray["_remove"]->addOnClick("ignoreValidation(this.form);"); if (!$this->_enabled && $this->_enabledSticky) { $newArray["_remove"]->setEnabled(false, true); } else { $newArray["_remove"]->setEnabled($removable, !$removable); } $this->_collections[] =& $newArray; $this->_num++; return $newArray; }
function __construct() { parent::__construct(); $this->setEventAndLabel("edu.middlebury.polyphony.wizard.save", dgettext("polyphony", "Save")); }
/** * This adds an iframe to the page that previews the frame, plus a button to refresh the view * * @return void * @access public * @since 8/8/06 */ function addIFrame($theStep) { //@todo It wouldn't be all that hard to add a series of three radio buttons, each allowing a new theme. It would be really cool and quite useful. //@todo I'm not sure if its a good idea or easy, but here's an idea--every time the user changes something, the thing relods, probably through javascript. I suspect it would make work frustratingly slow and be difficult though. $s = ""; $harmoni = Harmoni::instance(); $url = $harmoni->request->quickURL("gui", "test_page", array("theme" => theme_editorAction_wizardId . "__theme")); $refreshButton = $theStep->addComponent('refresh_preview', WEventButton::withLabel(_('Refresh...'))); $s .= "<hr />"; $s .= "\n\t<table width='100%'><tr>"; $s .= "\n\t\t<td align='left'><h2>Preview: </h2></td>"; $s .= "\n\t\t<td align='right'>Refresh preview: [[refresh_preview]]</td>"; $s .= "</tr></table>"; $s .= "\n\t\t<div style='background-color: #FFF'>"; $s .= "\n\t\t\t<iframe src='" . $url . "'width='100%' height='700' frameborder=1 scrolling='auto'>"; $s .= "\n\t\t\t\t<a href='" . $url . "'>Preview</a>"; $s .= "\n\t\t\t</iframe>"; $s .= "\n\t\t</div>"; return $s; }
/** * Returns a block of XHTML-valid code that contains markup for this specific * component. * @param string $fieldName The field name to use when outputting form data or * similar parameters/information. * @access public * @return string */ function getMarkup($fieldName) { $name = RequestContext::name($fieldName); $m = parent::getMarkup($fieldName); $m .= "\n<select name='" . $name . "_option'>"; foreach (array_keys($this->_options) as $option) { if ($option != '') { $m .= "\n\t<option value='" . addslashes($option) . "'>" . $option . "</option>"; } } $m .= "\n</select>"; return $m; }
/** * virtual constructor * @param string $event * @param string $label * @access public * @return ref object * @static */ static function withEventAndLabel($event, $label) { $obj = new WEventButton(); $obj->setEventAndLabel($event, $label); return $obj; }