public function render()
 {
     $output = parent::render();
     $output .= "<div class='form-element-wrapper'>";
     if ($this->label && $this->attributes['id']) {
         $output .= "<label for='" . o($this->attributes['id']) . "'>" . o($this->label) . ": </label>";
     }
     $output .= "<input" . $this->getAttributeString() . "/>";
     $output .= "</div>";
     return $output;
 }
 public function render()
 {
     $output = parent::render();
     $output .= "<div class='form-element-wrapper'>";
     if ($this->label && $this->attributes['id']) {
         $output .= "<label for='" . o($this->attributes['id']) . "'>" . o($this->label) . ": </label>";
     }
     $output .= "<select" . $this->getAttributeString() . ">";
     foreach ($this->options as $value => $option) {
         $option = o($option);
         $value = o($value);
         if ($value == $this->selected_option) {
             $output .= "<option selected value='{$value}'>{$option}</option>";
         } else {
             $output .= "<option value='{$value}'>{$option}</option>";
         }
     }
     $output .= "</select>";
     $output .= "</div>";
     return $output;
 }
Пример #3
0
 public function render($view_file, $values = array())
 {
     global $currentUser;
     return Entity::render($view_file, array_merge($values, array("avatar_url" => "/data/images/profiles/users/" . ($this['avatar'] ? $this['avatar'] : "default.png"), "parsed_message" => $this->getParsedMessage(), "parsed_signature" => Text::MessageToHtml($this['signature']), "view_profile_url" => "#", "formatted_post_date" => DateUtils::GetNice($this['post_date']), "edited" => $this['edit_by'] != '0', "edit_by" => $this['edit_by'], "edit_user" => $this['edit_user'], "edit_date" => DateUtils::GetNice($this['edit_date']), "is_mod" => $currentUser->isModOfForum($this['argument']), "can_edit" => $currentUser->isModOfForum($this['argument']) || $currentUser["id"] == $this['user_id'])));
 }