/** * */ public function selectLanguage($name, $value, $attribs = null) { //select version $config = Zend_Registry::get('config'); $siteVersions = $config->language->translations; foreach ($siteVersions as $locale => $label) { $data[$locale] = $this->view->getTranslation($label); } return $this->view->formSelect($name, $value, $attribs, $data); }
/** * * @param array $value * @param Zend_View_Interface $view * @return string */ public static function getHtml($value, Zend_View_Interface $view = null) { $value = json_decode($value, true); foreach (self::_getOptions() as $options) { switch ($options['type']) { case 'bool': $html .= $view->formRadio('confValue[' . $options['name'] . ']', $value[$options['id']], null, array('1' => Axis::translate()->__(' Yes'), '0' => Axis::translate()->__(' No'))); break; case 'select': $html .= $view->formSelect('confValue[' . $options['name'] . ']', $value[$options['id']], null, $options['config_options']); break; case 'multiple': $html .= '<br />'; foreach ($options['config_options'] as $key => $dataItem) { $html .= $view->formCheckbox('confValue[' . $options['name'] . '][' . $key . ']', isset($value[$options['name']][$key]) && $value[$options['name']][$key] ? 1 : null, null, array(1, 0)) . " {$dataItem} <br /> "; } break; case 'text': $html .= $view->formTextarea('confValue[' . $options['name'] . ']', $value[$options['id']], array('rows' => 8, 'cols' => 45)); break; default: $html .= $view->formText('confValue[' . $options['name'] . ']', $value[$options['id']], array('size' => '50')); } } return $html; }
public function _rowCompetence(array $competence, array $ratings, $in_person = FALSE) { static $standsCounter = 0; static $additsCounter = 0; $competen = new Rp_Db_Table_Ach_Cards_Competences(); $competen = $competen->find($competence['id'])->current(); $num = $competence['additional'] ? ++$additsCounter : ++$standsCounter; $name = $in_person === TRUE ? 'competences_in_person[' . $competence['id'] . ']' : 'competences[' . $competence['id'] . ']'; $kol = count($competen->fetchPersonalNotes($competen->id)); $note1 = '<div style="display:none" onclick="openNotesCompetence(' . $competence['id'] . ', 1)" title="Заметки">' . $kol . '</div>'; return ' <tr> <td class="compets-field-num"> <div>' . $num . '</div> </td> <td class="compets-field-name"> <div>' . $competence['name'] . '<div>' . $competence['target'] . '</div></div> </td> <td class="compets-field-note"> ' . $note1 . ' </td> <td class="compets-field-result"> <textarea name="' . $name . '[result_personal]" readonly="readonly">' . $competence['result_personal'] . '</textarea> </td> <td class="compets-field-rating"> ' . $this->view->formSelect($name . '[rating_id_personal]', $competence['rating_id_personal'], null, $ratings) . ' <div>' . $ratings[$competence['rating_id_personal']] . '</div> </td> </tr> '; }
/** * Generates a drop down box listing all instances that belong to the chosen instance * * @param Array list of all instances to which this user has access * @return string */ public function instanceSelect($instances) { $options[0] = ' '; foreach ($instances as $instance) { $options[$instance->instanceID] = $this->view->h($instance->instanceName); } return $this->view->formSelect('instance', null, null, $options); }
private function _rowTraining(Zend_Db_Table_Row_Abstract $training, array $methods, array $groupsMethods, array $respons, array $months, array $groupsMethodsActual) { static $counter = 0; if (empty($training->id)) { $num = '*'; $name = 'trainingPattern'; $class = 'row-pattern'; $toggle = '<div class="toggle-cancel-train" onclick="Card.removeRow(this)"> </div>'; end($months); $training->method_id = key($methods); $training->month_term_id = key($months); $training->responsible_id = key($respons); } else { $num = ++$counter; $name = 'trainings[' . $training->id . ']'; $class = ''; $toggle = ''; } $groupMethodsName = ''; foreach ($groupsMethods as $groupName => $items) { if (array_key_exists($training->method_id, $items)) { $groupMethodsName = $groupName; break; } } return ' <tr class="' . $class . '"> <td class="trains-field-num"> <div>' . $num . '</div>' . $toggle . ' </td> <td class="trains-field-situation"> <textarea name="' . $name . '[situation]" readonly>' . $training->situation . '</textarea> </td> <td class="trains-field-objective"> <textarea name="' . $name . '[objective]" readonly>' . $training->objective . '</textarea> </td> <td class="trains-field-method"> ' . $this->view->formSelect($name . '[method_id]', $training->method_id, null, $groupsMethodsActual) . ' <div title="' . $groupMethodsName . '">' . $groupMethodsName . ' <div title="' . $methods[$training->method_id] . '">' . $methods[$training->method_id] . '</div> </div> <textarea name="' . $name . '[method_comment]" readonly>' . $training->method_comment . '</textarea> </td> <td class="trains-field-responsible"> ' . $this->view->formSelect($name . '[responsible_id]', $training->responsible_id, null, $respons) . ' <div>' . $respons[$training->responsible_id] . '</div> <textarea name="' . $name . '[responsible_comment]" readonly>' . $training->responsible_comment . '</textarea> </td> <td class="trains-field-term"> ' . $this->view->formSelect($name . '[month_term_id]', $training->month_term_id, null, $months) . ' <div>' . $months[$training->month_term_id] . '</div> </td> <td class="trains-field-result"> <textarea name="' . $name . '[result]" readonly>' . $training->result . '</textarea> </td> </tr> '; }
/** * */ public function selectLayout($name, $value = null, $attr = null, $defaut = null) { $config = Zend_Registry::get('config'); $pathToPublicLayouts = $config->design->pathToPublicLayouts; $layouts = Digitalus_Filesystem_File::getFilesByType($pathToPublicLayouts, 'phtml'); if ($defaut == NULL) { $defaut = $this->view->getTranslation('Select One'); } $options[0] = $defaut; if (is_array($layouts)) { foreach ($layouts as $layout) { $options[$layout] = $layout; } return $this->view->formSelect($name, $value, $attr, $options); } else { return null; } }
/** * */ public function selectSkin($name, $value = null, $attr = null, $defaut = null) { $config = Zend_Registry::get('config'); $pathToPublicSkins = $config->design->pathToSkins; $skins = Digitalus_Filesystem_Dir::getDirectories($pathToPublicSkins); if ($defaut == NULL) { $defaut = $this->view->getTranslation('Select One'); } $options[0] = $defaut; if (is_array($skins)) { foreach ($skins as $skin) { $options[$skin] = $skin; } return $this->view->formSelect($name, $value, $attr, $options); } else { return null; } }
/** * Generates a drop down box listing all crypto profiles * * @param integer current crypto profile (or null if no current profile) * @param string element name * @return string */ public function cryptoSelect($cryptoID, $name = 'cryptoID') { $options[0] = 'none'; $cryptos = CryptoModel::getAllProfiles(); foreach ($cryptos as $crypto) { $profileName = $this->view->h($crypto->name); if (!isset($options[$crypto->cryptoID])) { $options[$crypto->cryptoID] = $profileName; } } return $this->view->formSelect($name, $cryptoID, null, $options); }
/** * Generates a drop down box listing all instances that belong to the chosen instance * * @param Array list of all instances to which this user has access * @param integer id of questionnaire that has been selected * @return string */ public function instanceSelect($instances, $questionnaire, $name = 'instance', $instanceID = null) { if ($questionnaire === null) { $options[0] = 'Select a questionnaire'; } else { $options[0] = ' '; foreach ($instances as $instance) { $questionnaireName = $this->view->h($instance->questionnaireName); $instanceName = $this->view->h($instance->instanceName); if ($instance->questionnaireID == $questionnaire) { $options[$instance->instanceID] = $instanceName; } } } return $this->view->formSelect($name, $instanceID, null, $options); }
/** * */ public function selectDoctype($name, $value, $attr = null) { $data = array('XHTML1_TRANSITIONAL' => 'XHTML1_TRANSITIONAL', 'XHTML11' => 'XHTML11', 'XHTML1_STRICT' => 'XHTML1_STRICT', 'XHTML1_FRAMESET' => 'XHTML1_FRAMESET', 'XHTML_BASIC1' => 'XHTML_BASIC1', 'HTML4_STRICT' => 'HTML4_STRICT', 'HTML4_LOOSE' => 'HTML4_LOOSE', 'HTML4_FRAMESET' => 'HTML4_FRAMESET'); return $this->view->formSelect($name, $value, $attr, $data); }
/** * */ public function selectTimezone($name, $value, $attr = null) { $data = Digitalus_Validate_Timezone::getValidTimezones(null, true); return $this->view->formSelect($name, $value, $attr, $data); }
/** * * @param string $value * @param Zend_View_Interface $view * @return string */ public static function getHtml($value, Zend_View_Interface $view = null) { return $view->formSelect('confValue', $value, null, Axis_Collect_Currency::collect()); }
private function _rowTask(Zend_Db_Table_Row_Abstract $task, array $ratings, $func, $counter = null) { if ($func) { $table = 'functasks'; } else { $table = 'tasks'; } if (empty($task->id)) { $num = '*'; $term = ''; //(date('n') < 12 ? date('Y') : (date('Y') + 1)) . '-12-31'; $note = ''; $name = 'taskPattern'; $class = 'row-pattern'; $toggle = '<div class="toggle-cancel" onclick="Card.removeRow(this, \'' . $table . '\')"> </div>'; $weight = '0'; } else { $all_notes = new Rp_Db_Table_Ach_Tasks_Notes(); $kol = count($all_notes->fetchTaskNotes($task->id)); $num = $counter; $term = ''; $term_date = ''; if ($task->date_term != null) { $term = $task->date_term; $term_date = date('d.m.y', strtotime($term)); } $note = '<div style="display:none" onclick="openNotes(' . $task->id . ' , 0)" title="Заметки" style:>' . $kol . '</div>'; $name = 'tasks[' . $task->id . ']'; $weight = $task->weight; $class = ''; $toggle = ''; if ($task->status == '0') { $class = 'row-canceled'; } elseif ($task->status > 0) { $class = 'row-approval'; } if ($task->status != 2) { $toggle = '<div class="toggle-cancel" onclick="Card.toggleCancel(this, \'' . $table . '\')"> </div>'; } } return ' <tr class="' . $class . '"> <td class="tasks-field-num"> <input name="' . $name . '[status]" type="hidden" value="' . $task->status . '" /> <div>' . $num . '</div>' . $toggle . ' </td> <td class="tasks-field-description"> <textarea name="' . $name . '[description]" readonly="readonly">' . $task->description . '</textarea> </td> <td class="tasks-field-term"> <input name="term_display" type="text" value="' . $term_date . '" readonly="readonly" /> <input name="' . $name . '[date_term]" type="hidden" value="' . $term . '" /> </td> <td class="tasks-field-weight"> <textarea name="' . $name . '[weight]" readonly="readonly">' . $weight . '</textarea> </td> <td class="tasks-field-note"> ' . $note . ' <input name="' . $name . '[is_functional]" type="hidden" value="' . $func . '" /> </td> <td class="tasks-field-result"> <textarea name="' . $name . '[result]" readonly="readonly">' . $task->result . '</textarea> </td> <td class="tasks-field-rating"> ' . $this->view->formSelect($name . '[rating_id]', $task->rating_id, null, $ratings) . ' <div>' . $ratings[$task->rating_id] . '</div> </td> </tr> '; }