public function render() { /* bind optional action to field */ if ($this->_obj->getAction()) { $this->_bindAction($this->_obj->getAction()); View::addEvent(sprintf("jQuery('#%s').focus()", $this->_id), 'js'); } $name = $this->getId(); if ($this->getParameter('mode') == View\FormComponent::SEARCH_MODE) { $name = ViewUri::getUriAdapter()->getIdentifier('search') . '[' . $this->_nametoDomId($name) . ']'; } $html = sprintf('<input type="hidden" name="%s" id="%s" value="%s"/>', $name, $this->_obj->getId(), $this->_obj->getValue()); $zv = new \Zend_View(); $options = array(null => $this->getParameter('defaultlabel')) + $this->_obj->getEnumValues(TimeProperty::HOUR_PART); $html .= $zv->formSelect($name . '_hour', $this->_obj->getValue(TimeProperty::HOUR_PART), null, $options); $options = array(null => $this->getParameter('defaultlabel')) + $this->_obj->getEnumValues(TimeProperty::MIN_PART); $html .= ' : ' . $zv->formSelect($name . '_minute', $this->_obj->getValue(TimeProperty::MIN_PART), null, $options); View::addCoreLib('view:form.js'); View::addEvent(sprintf("new t41.view.form.timeElement('%s')", $this->_obj->getId()), 'js'); return $html; }
public function loadTreeMenuSelectBox($name, $FirstItem = null, $selected = null, $attribsSelect = null, $subtractId = null) { $objMenus = new Model_Menus(); $FirstItem = $FirstItem == null ? 0 : $FirstItem; $menuLevelOnes = $objMenus->fetchAll("parent = {$FirstItem}", "order ASC"); $options = array(); if ($FirstItem == 0) { $options[0] = "/ ROOT"; } else { $options[0] = $objMenus->fetchRow("menu_id = {$FirstItem}")->name; } $this->_loadMenuTree($menuLevelOnes, $options, 1, $subtractId); $view = new Zend_View(); return $view->formSelect($name, $selected, $attribsSelect, $options); }
public function render() { // set correct name for field name value depending on 'mode' parameter value $name = $this->_obj->getId(); if ($this->getParameter('mode') == View\FormComponent::SEARCH_MODE) { $name = ViewUri::getUriAdapter()->getIdentifier('search') . '[' . $name . ']'; $this->setParameter('radiomax', 0); } if (count($this->_obj->getEnumValues()) > $this->getParameter('radiomax')) { // display menu list $options = array(null => $this->getParameter('defaultlabel')) + (array) $this->_obj->getEnumValues(); $zv = new \Zend_View(); return $zv->formSelect($name, $this->_obj->getValue(), null, $options); } else { $html = ''; foreach ($this->_obj->getEnumValues() as $key => $val) { $html .= sprintf('<input type="radio" name="%s" id="%s_%s" value="%s"%s/> <label for="%s_%s">%s</label> ', $name, $name, $key, $key, $key == $this->_obj->getValue() ? ' checked="checked"' : null, $name, $key, $this->_escape($val)); } return $html; } }
public function render() { /* bind optional action to field */ if ($this->_obj->getAction()) { $this->_bindAction($this->_obj->getAction()); View::addEvent(sprintf("jQuery('#%s').focus()", $this->_id), 'js'); } $name = $this->getId(); $value = explode('.', $this->_obj->getValue()); if ($this->getParameter('mode') == View\FormComponent::SEARCH_MODE) { $name = ViewUri::getUriAdapter()->getIdentifier('search') . '[' . $this->_nametoDomId($name) . ']'; } $html = sprintf('<input type="hidden" name="%s" id="%s" value="%s"/>', $name, $this->_obj->getId(), $this->_obj->getValue()); $html .= sprintf('<input type="text" id="%s_number" size="3" maxlength="4"/>', $this->_obj->getId()); $options = array('2' => 'Bis', '3' => 'Ter', '4' => 'Quater', 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D'); $options = array(null => $this->getParameter('defaultlabel')) + $options; $zv = new \Zend_View(); $html .= $zv->formSelect(null, null, array('id' => $this->_obj->getId() . '_ext'), $options); View::addCoreLib('view:form.js'); View::addEvent(sprintf("new t41.view.form.streetNumber('%s')", $this->_obj->getId()), 'js'); return $html; }
public function render() { if (($value = $this->_obj->getValue()) !== false) { if (($value instanceof ObjectModel\BaseObject || $value instanceof ObjectModel\DataObject) && $value->getUri()) { $value = $this->_obj->getParameter('altkey') ? $value->getProperty($this->_obj->getParameter('altkey'))->getValue() : $value->getUri()->getIdentifier(); } else { if ($value instanceof ObjectModel\ObjectUri) { $value = $value->getIdentifier(); } else { if ($this->_obj->getDefaultValue()) { $value = is_object($this->_obj->getDefaultValue()) ? $this->_obj->getDefaultValue()->getIdentifier() : $this->_obj->getDefaultValue(); } else { $value = null; } } } } // display autocompleter field if ($this->_obj->getTotalValues() > $this->_obj->getParameter('selectmax')) { $params = array(); foreach ($this->_params as $key => $param) { $params[$key] = $param->getValue(); } $deco = new WebAutocomplete($this->_obj, $params); return $deco->render(); } else { // set correct name for field name value depending on 'mode' parameter value $name = $this->_obj->getId(); if ($this->getParameter('mode') == View\FormComponent::SEARCH_MODE) { $name = ViewUri::getUriAdapter()->getIdentifier('search') . '[' . $name . ']'; } // display menu list $zv = new \Zend_View(); $options = array(Property::EMPTY_VALUE => $this->getParameter('defaultlabel')) + (array) $this->_obj->getEnumValues(); return $zv->formSelect($name, $value, null, $options); } }