/** * Returns the HTML for the properties part in the properties view * * @return string */ function formProperties() { // Create table $_content = new we_html_table(array('class' => 'default propertydualtable'), 5, 3); $row = 0; // Row 1 $_content->setCol($row, 0, null, $this->formInputInfo2(155, 'width', 10, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"', "origwidth")); $_content->setCol($row, 1, null, $this->formInputInfo2(155, 'height', 10, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"', "origheight")); $_content->setCol($row++, 2, null, $this->formInput2(155, 'border', 10, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"')); // Row 2 $_content->setCol($row, 0, null, $this->formInput2(155, 'align', 10, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"')); $_content->setCol($row, 1, null, $this->formInput2(155, 'hspace', 10, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"')); $_content->setCol($row++, 2, null, $this->formInput2(155, 'vspace', 10, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"')); // Row 3 $_content->setCol($row, 0, array('colspan' => 3), $this->formInput2(328, 'alt', 23, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"')); $_content->setCol($row++, 2, null, $this->formInput2(155, 'name', 10, 'attrib', 'onchange="_EditorFrame.setEditorIsHot(true);"')); // Row 4 $_content->setCol($row, 0, array('colspan' => 3), $this->formInput2(328, 'title', 23, 'attrib', ($this->getElement('useMetaTitle') == 1 ? "readonly='readonly'" : "") . '" onchange="_EditorFrame.setEditorIsHot(true);"', 'Title')); $_titleField = 'we_' . $this->Name . '_attrib[title]'; $_metaTitleField = 'we_' . $this->Name . '_txt[Title]'; $useMetaTitle = 'we_' . $this->Name . '_attrib[useMetaTitle]'; // disable field 'title' when checked or not. on checked true: document.forms[0]['$_titleField'].value='$this->getElement('Title')' and onchecked false: document.forms[0]['$_titleField'].value='' added to fix bug #5814 $_content->setCol($row++, 2, array('style' => 'vertical-align:bottom'), we_html_forms::checkboxWithHidden($this->getElement('useMetaTitle'), $useMetaTitle, g_l('weClass', '[use_meta_title]'), false, 'defaultfont', "if(this.checked){ document.forms[0]['" . $_titleField . "'].setAttribute('readonly', 'readonly', 'false'); document.forms[0]['" . $_titleField . "'].value = '" . $this->getElement('Title') . "'; }else{ document.forms[0]['" . $_titleField . "'].removeAttribute('readonly', 'false'); document.forms[0]['" . $_titleField . "'].value='';}_EditorFrame.setEditorIsHot(true);")); // longdesc should be available in images. // check if longdesc is set and get path $longdesc_id_name = 'we_' . $this->Name . '_attrib[longdescid]'; $longdesc_text_name = 'tmp_longdesc'; $longdesc_id = $this->getElement('longdescid'); $longdescPath = $longdesc_id ? id_to_path($longdesc_id) : ''; $yuiSuggest =& weSuggest::getInstance(); $yuiSuggest->setAcId('LonDesc'); $yuiSuggest->setContentType('folder,' . we_base_ContentTypes::WEDOCUMENT . ',' . we_base_ContentTypes::HTML); $yuiSuggest->setInput($longdesc_text_name, $longdescPath); $yuiSuggest->setLabel(g_l('weClass', '[longdesc_text]')); $yuiSuggest->setMaxResults(20); $yuiSuggest->setMayBeEmpty(1); $yuiSuggest->setResult($longdesc_id_name, $longdesc_id); $yuiSuggest->setSelector(weSuggest::DocSelector); $yuiSuggest->setWidth(328); $cmd1 = "document.we_form.elements['" . $longdesc_id_name . "'].value"; $yuiSuggest->setSelectButton(we_html_button::create_button(we_html_button::SELECT, "javascript:we_cmd('we_selector_image'," . $cmd1 . ",'" . FILE_TABLE . "','" . we_base_request::encCmd($cmd1) . "','" . we_base_request::encCmd("document.we_form.elements['" . $longdesc_text_name . "'].value") . "','" . we_base_request::encCmd("opener._EditorFrame.setEditorIsHot(true);opener.top.we_cmd('reload_editpage');") . "','','','" . we_base_ContentTypes::WEDOCUMENT . "," . we_base_ContentTypes::TEXT . "," . we_base_ContentTypes::HTML . "',1)")); $yuiSuggest->setTrashButton(we_html_button::create_button(we_html_button::TRASH, "javascript:document.we_form.elements['" . $longdesc_id_name . "'].value='-1';document.we_form.elements['" . $longdesc_text_name . "'].value='';_EditorFrame.setEditorIsHot(true); YAHOO.autocoml.setValidById('" . $yuiSuggest->getInputId() . "')")); $_content->setCol($row, 0, array('style' => 'vertical-align:bottom', 'colspan' => 5), $yuiSuggest->getHTML() . $yuiSuggest->getYuiJs()); // Return HTML return $_content->getHtml(); }
?> <we:listview type="document" name="getContentofDocument" cfilter="false" contenttypes="text/webedition" id="\$weDocumentID" rows="1"> <we:repeat> </we:repeat> <?php $contentElements = unserialize($GLOBALS['lv']->f('ContentElement')); if ($contentElements) { foreach ($contentElements as $value) { $slideImgID = $GLOBALS['lv']->f('Slideblk_ContentElement_' . $value); $slideContent = $GLOBALS['lv']->f('SeitenInhaltblk_ContentElement_' . $value); $slideModeLearn = $GLOBALS['lv']->f('Lernenblk_ContentElement_' . $value); $slideModeLearn = (bool) $slideModeLearn ? 'learn' : ''; $slideLearnTreat = $GLOBALS['lv']->f('Behandelnblk_ContentElement_' . $value); $slideLearnTreat = (bool) $slideLearnTreat ? 'treat' : ''; if (!empty($slideImgID)) { $GLOBALS['content'] .= '<div class="' . $slideModeLearn . ' ' . $slideLearnTreat . '"><img src="http://' . $_SERVER['HTTP_HOST'] . id_to_path($slideImgID) . '" alt="" class="pic folie"/></div>'; } if (!empty($slideContent)) { $GLOBALS['content'] .= '<div class="' . $slideModeLearn . ' ' . $slideLearnTreat . '">' . we_document::parseInternalLinks($slideContent, 0) . '</div>'; } /** * use this for base encode image data instead of using http links to images * if(!empty($slideImgID)){ $imgPath = $_SERVER['DOCUMENT_ROOT'].id_to_path($slideImgID); if (file_exists($imgPath)) { $extension = pathinfo($imgPath, PATHINFO_EXTENSION); switch ($extension) { case 'jpg': case 'jpeg': $mime = 'image/jpeg';