예제 #1
0
 /**
  * @see FormElement::renderInput()
  *
  * @param array $params
  * @return string
  */
 public function renderInput($params = null)
 {
     parent::renderInput($params);
     $this->addAttribute('type', 'hidden');
     $this->addAttribute('class', 'userFieldHidden');
     $this->addAttribute('placeholder', OW::getLanguage()->text('mailbox', 'to'));
     $input = new UserFieldRenderable();
     $input->assign('input', UTIL_HtmlTag::generateTag('input', $this->attributes));
     return $input->render();
 }
예제 #2
0
 /**
  * @see FormElement::renderInput()
  *
  * @param array $params
  * @return string
  */
 public function renderInput($params = null)
 {
     parent::renderInput($params);
     if ($this->getValue() !== null) {
         $this->addAttribute('value', $this->value);
     } else {
         if ($this->getHasInvitation()) {
             $this->addAttribute('value', $this->invitation);
             $this->addAttribute('class', 'invitation');
         }
     }
     $tag = UTIL_HtmlTag::generateTag('input', $this->attributes);
     if ($this->showCloseButton) {
         $tag .= '<a href="javascript://" class="ow_btn_close_search" id="' . $this->attributes['name'] . '_close_btn_search"></a>';
     }
     return $tag;
 }
예제 #3
0
 /**
  * @see FormElement::renderInput()
  *
  * @param array $params
  * @return string
  */
 public function renderInput($params = null)
 {
     parent::renderInput($params);
     if ($this->textarea !== null) {
         return $this->textarea->renderInput();
     }
     if (OW::getRegistry()->get('baseWsInit') === null) {
         $language = OW::getLanguage();
         $languageDto = BOL_LanguageService::getInstance()->getCurrent();
         $array = array('editorCss' => OW::getPluginManager()->getPlugin('base')->getStaticCssUrl() . 'htmlarea_editor.css', 'themeImagesUrl' => OW::getThemeManager()->getCurrentTheme()->getStaticImagesUrl(), 'imagesUrl' => OW::getRouter()->urlFor('BASE_CTRL_MediaPanel', 'index', array('pluginKey' => 'blog', 'id' => '__id__')), 'labels' => array('buttons' => array('bold' => $language->text('base', 'ws_button_label_bold'), 'italic' => $language->text('base', 'ws_button_label_italic'), 'underline' => $language->text('base', 'ws_button_label_underline'), 'orderedlist' => $language->text('base', 'ws_button_label_orderedlist'), 'unorderedlist' => $language->text('base', 'ws_button_label_unorderedlist'), 'link' => $language->text('base', 'ws_button_label_link'), 'image' => $language->text('base', 'ws_button_label_image'), 'video' => $language->text('base', 'ws_button_label_video'), 'html' => $language->text('base', 'ws_button_label_html'), 'more' => $language->text('base', 'ws_button_label_more'), 'switchHtml' => $language->text('base', 'ws_button_label_switch_html')), 'common' => array('buttonAdd' => $language->text('base', 'ws_add_label'), 'buttonInsert' => $language->text('base', 'ws_insert_label'), 'videoHeadLabel' => $language->text('base', 'ws_video_head_label'), 'htmlHeadLabel' => $language->text('base', 'ws_html_head_label'), 'htmlTextareaLabel' => $language->text('base', 'ws_html_textarea_label'), 'videoTextareaLabel' => $language->text('base', 'ws_video_textarea_label'), 'linkTextLabel' => $language->text('base', 'ws_link_text_label'), 'linkUrlLabel' => $language->text('base', 'ws_link_url_label'), 'linkNewWindowLabel' => $language->text('base', 'ws_link_new_window_label')), 'messages' => array('imagesEmptyFields' => $language->text('base', 'ws_image_empty_fields'), 'linkEmptyFields' => $language->text('base', 'ws_link_empty_fields'), 'videoEmptyField' => $language->text('base', 'ws_video_empty_field'))), 'buttonCode' => OW::getThemeManager()->processDecorator('button', array('label' => '#label#', 'class' => 'ow_ic_add mn_submit')), 'rtl' => $languageDto !== null && (bool) $languageDto->getRtl() ? true : false);
         $script = "window.htmlAreaData = " . json_encode($array);
         OW::getDocument()->addScriptDeclarationBeforeIncludes($script);
         OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'htmlarea.js');
         OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('base')->getStaticCssUrl() . 'htmlarea.css');
         OW::getRegistry()->set('baseWsInit', true);
     }
     $params = array('toolbar' => $this->buttons, 'size' => $this->size);
     if (!empty($this->customBodyClass)) {
         $params["customClass"] = $this->customBodyClass;
     }
     OW::getDocument()->addOnloadScript("\r\n            \$('#{$this->getId()}').get(0).htmlarea = function(){ \$(this).htmlarea( " . json_encode($params) . " );};\r\n            \$('#{$this->getId()}').get(0).htmlareaFocus = function(){this.jhtmlareaObject.iframe[0].contentWindow.focus();};\r\n            \$('#{$this->getId()}').get(0).htmlareaRefresh = function(){if(this.jhtmlareaObject){this.jhtmlareaObject.dispose();\$(this).htmlarea( " . json_encode($params) . " );}};\r\n        ");
     if ($this->value === null && $this->getHasInvitation()) {
         $this->addAttribute('value', $this->getInvitation());
         $this->addAttribute('class', 'invitation');
     }
     if ($this->init) {
         OW::getDocument()->addOnloadScript("\$('#{$this->getId()}').htmlarea( " . json_encode($params) . " );");
     }
     $this->removeAttribute('value');
     if ($this->value === null && $this->getHasInvitation()) {
         $markup = UTIL_HtmlTag::generateTag('textarea', $this->attributes, true, $this->getInvitation());
     } else {
         $markup = UTIL_HtmlTag::generateTag('textarea', $this->attributes, true, htmlspecialchars(BOL_TextFormatService::getInstance()->processWsForInput($this->value, array('buttons' => $this->buttons))));
     }
     return $markup;
 }
예제 #4
0
 /**
  * @see FormElement::renderInput()
  *
  * @param array $params
  * @return string
  */
 public function renderInput($params = null)
 {
     parent::renderInput($params);
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('googlelocation')->getStaticJsUrl() . 'location.js', "text/javascript", GOOGLELOCATION_BOL_LocationService::JQUERY_LOAD_PRIORITY + 1);
     $name = json_encode($this->getName());
     $id = json_encode($this->getId());
     $lat = !empty($this->value['latitude']) ? (double) $this->value['latitude'] : 0;
     $lon = !empty($this->value['longitude']) ? (double) $this->value['longitude'] : 0;
     $northEastLat = !empty($this->value['northEastLat']) ? (double) $this->value['northEastLat'] : 0;
     $northEastLng = !empty($this->value['northEastLng']) ? (double) $this->value['northEastLng'] : 0;
     $southWestLat = !empty($this->value['southWestLat']) ? (double) $this->value['southWestLat'] : 0;
     $southWestLng = !empty($this->value['southWestLng']) ? (double) $this->value['southWestLng'] : 0;
     $params = array('lat' => $lat, 'lng' => $lon, 'northEastLat' => $northEastLat, 'northEastLng' => $northEastLng, 'southWestLat' => $southWestLat, 'southWestLng' => $southWestLng, 'region' => $this->region, 'countryRestriction' => GOOGLELOCATION_BOL_LocationService::getInstance()->getCountryRestriction(), 'customMarkerIcon' => GOOGLELOCATION_BOL_LocationService::getInstance()->getDefaultMarkerIcon());
     OW::getDocument()->addOnloadScript(' $( document ).ready( function(){ window.googlemap_location = new OW_GoogleMapLocation( ' . json_encode($this->getName()) . ', ' . json_encode($this->getId()) . ', ' . json_encode($this->getName() . '_map') . ' );
                                          window.googlemap_location.initialize(' . json_encode($params) . '); }); ');
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[address]', 'value' => !empty($this->value['address']) ? $this->escapeValue($this->value['address']) : '');
     $html = UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[latitude]', 'value' => !empty($this->value['latitude']) ? $this->escapeValue($this->value['latitude']) : '');
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[longitude]', 'value' => !empty($this->value['longitude']) ? $this->escapeValue($this->value['longitude']) : '');
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[northEastLat]', 'value' => !empty($this->value['northEastLat']) ? $this->escapeValue($this->value['northEastLat']) : '');
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[northEastLng]', 'value' => !empty($this->value['northEastLng']) ? $this->escapeValue($this->value['northEastLng']) : '');
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[southWestLat]', 'value' => !empty($this->value['southWestLat']) ? $this->escapeValue($this->value['southWestLat']) : '');
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[southWestLng]', 'value' => !empty($this->value['southWestLng']) ? $this->escapeValue($this->value['southWestLng']) : '');
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[json]', 'value' => !empty($this->value['json']) ? $this->escapeValue($this->value['json']) : '');
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = array('type' => 'hidden', 'name' => $this->getName() . '[remove]', 'value' => !empty($this->value['remove']) ? $this->escapeValue($this->value['remove']) : false);
     $html .= UTIL_HtmlTag::generateTag('input', $attribute);
     $attribute = $this->attributes;
     unset($attribute['name']);
     $attribute['value'] = !empty($this->value['address']) ? $this->value['address'] : '';
     $attribute['class'] .= ' ow_left ow_googlelocation_location_input';
     if (empty($attribute['value']) && $this->hasInvitation) {
         $attribute['value'] = $this->invitation;
         $attribute['class'] .= ' invitation';
     }
     $html .= '<div class="googlelocation_form_element_div clearfix">' . UTIL_HtmlTag::generateTag('input', $attribute) . '<div class="googlelocation_address_icon_div">
                     <span id=' . json_encode($this->getId() . '_icon') . ' style="' . (!empty($this->value['json']) ? 'display:none' : 'display:inline') . '" class="ic_googlemap_pin googlelocation_address_icon"></span>
                     <div id=' . json_encode($this->getId() . '_delete_icon') . '  style="' . (empty($this->value['json']) ? 'display:none' : 'display:inline') . '" class="ow_miniic_delete googlelocation_delete_icon"></div>
                 </div>
              </div>';
     $html .= '<div id="' . $this->getName() . '_map" style="margin-top:10px;width:90%;height:200px;display:none;"></div>';
     return $html;
 }