echo TEXT_CC;
        ?>
</td>
										  <td width="90%"><?php 
        echo olc_draw_textarea_field('cc', 'soft', '100%', '3', $newsletters_data['cc']);
        ?>
</td>
										</tr>
							      <tr>
								      <td width="10%" valign="top"><?php 
        echo TEXT_BODY;
        ?>
</td>
								      <td width="90%"><?php 
        $sw = new SPAW_Wysiwyg($control_name = 'newsletter_body', $value = stripslashes($newsletters_data['body']), $lang = EMPTY_STRING, $mode = 'full', $theme = 'default', $width = '100%', $height = '800px', $css_stylesheet = SPAW_STYLESHEET, $dropdown_data = EMPTY_STRING);
        $sw->show();
        ?>
								      </td>
								   </tr>
							   </table>
							   <a href="<?php 
        echo olc_href_link(FILENAME_MODULE_NEWSLETTER);
        ?>
">
							   <?php 
        echo olc_image_button('button_back.gif', IMAGE_BACK);
        ?>
</a>
							   <right><?php 
        echo olc_image_submit('button_save.gif', IMAGE_SAVE);
        ?>
Ejemplo n.º 2
0
 function GetSPAW($fieldname = 'spaw', $fieldvalue = '', $width = '650px', $height = '200px', $style = 'default')
 {
     global $control_name, $spaw_root, $spaw_dir, $spaw_default_lang, $spaw_dropdown_data;
     global $HTTP_SERVER_VARS, $HTTP_HOST, $DOCUMENT_ROOT;
     $available_styles = array("mini", "default", "classic");
     if (!in_array($style, $available_styles)) {
         $style = "mini";
     }
     $content = "";
     if ($this->SPAW_called == false) {
         define('DR', "{$DOCUMENT_ROOT}/");
         $spaw_root = DR . 'components/spaw/';
         $spaw_dir = "/components/spaw/";
         include $spaw_root . "spaw_control.class.php";
         $this->SPAW_called = true;
     }
     if ($style == "default" || $style == "classic") {
         $sw = new SPAW_Wysiwyg($fieldname, stripslashes($fieldvalue), 'en', 'full', $style, $width, $height);
     } elseif ($style == "mini") {
         $sw = new SPAW_Wysiwyg($fieldname, stripslashes($fieldvalue), 'en', 'mini', 'default', $width, $height, '');
     }
     $content .= $sw->show();
     print $content;
 }
Ejemplo n.º 3
0
 function GetSPAW($fieldname = 'spaw', $fieldvalue = '', $width = '550px', $height = '150px', $style = 'default', $displayoutput = true)
 {
     global $control_name, $spaw_root, $spaw_dir, $spaw_default_lang, $spaw_dropdown_data;
     global $HTTP_SERVER_VARS, $HTTP_HOST, $DOCUMENT_ROOT;
     $available_styles = array("mini", "default", "classic");
     if (!in_array($style, $available_styles)) {
         $style = "mini";
     }
     $content = "";
     if ($this->spawcalled == false) {
         define('DR', "{$DOCUMENT_ROOT}/");
         $spaw_root = DR . 'components/spaw/';
         $spaw_dir = "/components/spaw/";
         //ob_start();
         include $spaw_root . "spaw_control.class.php";
         //$content .= ob_get_contents();
         //ob_end_clean();
         $this->spawcalled = true;
         //print "CALLING $fieldname SPAW";
     }
     $content .= "";
     //$content .= "<form name=xxx_$fieldname>";
     if ($style == "default" || $style == "classic") {
         $sw = new SPAW_Wysiwyg($fieldname, stripslashes($fieldvalue), 'en', 'full', $style, $width, $height);
     } elseif ($style == "mini") {
         $sw = new SPAW_Wysiwyg($fieldname, stripslashes($fieldvalue), 'en', 'mini', 'default', $width, $height, '');
     }
     $content .= $sw->show();
     //$content .= "</form name=xxx>";
     if ($displayoutput == true) {
         print $content;
     } else {
         return $content;
     }
 }
Ejemplo n.º 4
0
function display_edit_form($cat_array, $form_title, $action)
{
    global $cattree, $table_icon;
    global $gnavi_defaultlat;
    global $gnavi_defaultlng;
    global $gnavi_defaultzoom;
    global $gnavi_defaultmtype;
    global $gnavi_googlemapapi_key;
    global $gnavi_usegooglemap, $xoopsDB;
    global $gnavi_lang_java;
    global $gnavi_body_editor;
    global $gnavi_googlemap_url;
    $myts =& MyTextSanitizer::getInstance();
    extract($cat_array);
    // Beggining of XoopsForm
    $form = new XoopsThemeForm($form_title, 'MainForm', '');
    // Hidden
    $form->addElement(new XoopsFormHidden('action', $action));
    $form->addElement(new XoopsFormHidden('cid', $cid));
    // Title
    $form->addElement(new XoopsFormText(_MD_A_GNAVI_CAT_TH_TITLE, 'title', 30, 50, $myts->htmlSpecialChars($title)), true);
    // Image URL
    $form->addElement(new XoopsFormText(_MD_A_GNAVI_CAT_TH_IMGURL, 'imgurl', 50, 150, $myts->htmlSpecialChars($imgurl)));
    // Kml URL
    $form->addElement(new XoopsFormText(_MD_A_GNAVI_CAT_TH_KMLURL, 'kmlurl', 50, 150, $myts->htmlSpecialChars($kmlurl)));
    // Parent Category
    ob_start();
    $cattree->makeMySelBox("title", "weight", $pid, 1, 'pid');
    $cat_selbox = ob_get_contents();
    ob_end_clean();
    $form->addElement(new XoopsFormLabel(_MD_A_GNAVI_CAT_TH_PARENT, $cat_selbox));
    //----------------------------editor-------------------------------------------
    if ($gnavi_body_editor == 'common_fckeditor') {
        // FCKeditor in common/fckeditor/
        $jscript = '
			<script type="text/javascript" src="' . XOOPS_URL . '/common/fckeditor/fckeditor.js"></script>
			<script type="text/javascript"><!--
				function fckeditor_exec() {
					var oFCKeditor = new FCKeditor( "description" , "100%" , "500" , "Default" );
					
					oFCKeditor.BasePath = "' . XOOPS_URL . '/common/fckeditor/";
					
					oFCKeditor.ReplaceTextarea();
				}
			// --></script>
		';
        $wysiwyg_body = '<textarea id="description" name="description">' . htmlspecialchars($description, ENT_QUOTES) . '</textarea><script>fckeditor_exec();</script>';
        $desc_tarea = new XoopsFormLabel(_MD_A_GNAVI_CAT_TH_DESC, $jscript . $wysiwyg_body);
    } else {
        if ($gnavi_body_editor == 'common_spaw' && file_exists(XOOPS_ROOT_PATH . '/common/spaw/spaw_control.class.php')) {
            // older spaw in common/spaw/
            include XOOPS_ROOT_PATH . '/common/spaw/spaw_control.class.php';
            ob_start();
            $sw = new SPAW_Wysiwyg("description", $description);
            $sw->show();
            $wysiwyg_body = ob_get_contents();
            ob_end_clean();
            $desc_tarea = new XoopsFormLabel(_MD_A_GNAVI_CAT_TH_DESC, $wysiwyg_body);
        } else {
            if ($gnavi_body_editor == 'pure_html') {
                $desc_tarea = new XoopsFormTextArea(_MD_A_GNAVI_CAT_TH_DESC, "description", $myts->makeTareaData4Edit($description), 20, 60);
            } else {
                $desc_tarea = new XoopsFormDhtmlTextArea(_MD_A_GNAVI_CAT_TH_DESC, "description", $myts->makeTareaData4Edit($description), 20, 60);
            }
        }
    }
    $form->addElement($desc_tarea);
    //---------------------------------------------------------------------------------
    $form->addElement(new XoopsFormText(_MD_A_GNAVI_CAT_TH_WEIGHT, 'weight', 5, 3, $myts->htmlSpecialChars($weight)));
    //Google Maps
    if ($gnavi_usegooglemap) {
        $set_latlng_state = "";
        if ($lat == 0 && $lng == 0) {
            $lat = $gnavi_defaultlat;
            $lng = $gnavi_defaultlng;
            $zoom = $gnavi_defaultzoom;
            $mtype = $gnavi_defaultmtype;
            if ($action == "update") {
                $set_latlng_state = "checked";
            }
        }
        $gmap = new XoopsFormLabel(_MD_GNAV_MAP, "\n<div><input type='checkbox' name='set_latlng' id='set_latlng' value='1' onclick='ChangeMapArea(this)' {$set_latlng_state}/>&nbsp;" . _MD_GNAV_MAP_UNINPUT . "</div>\n<div id='maparea'>\n<div id='map' style='width:100%;height:400px;'></div>\n<div id='gn_latlng'>" . _MD_GNAV_MAP_LAT . ":&nbsp;<span id='slat'>" . $myts->makeTboxData4Edit($lat) . "</span>&nbsp;&nbsp;&nbsp;" . _MD_GNAV_MAP_LNG . ":&nbsp;<span id='slng'>" . $myts->makeTboxData4Edit($lng) . "</span>&nbsp;&nbsp;&nbsp;" . _MD_GNAV_MAP_ZOOM . ":&nbsp;<span id='sz'>" . $myts->makeTboxData4Edit($zoom) . "</span></div>\n<input type='hidden' name='lat' id='lat' size='20' value='" . $myts->makeTboxData4Edit($lat) . "' />\n<input type='hidden' name='lng' id='lng' size='20' value='" . $myts->makeTboxData4Edit($lng) . "' />\n<input type='hidden' name='z' id='z' size='20' value='" . $myts->makeTboxData4Edit($zoom) . "' />\n<input type='hidden' name='mt' id='mt' size='30' value='" . $myts->makeTboxData4Edit($mtype) . "' />\n</div>\n<script src='" . $gnavi_googlemap_url . "/maps?file=api&amp;v=2&amp;key={$gnavi_googlemapapi_key}' type='text/javascript' charset='utf-8'></script>\n<script src='../js/map.js' type='text/javascript' charset='utf-8'></script>\n<script type='text/javascript'>\n//<![CDATA[\n\t{$gnavi_lang_java}\n\twindow.onload = InputGMap;\n//]]>\n</script>");
        $form->addElement($gmap);
        $icon_select = new XoopsFormSelect(_MD_GNAV_MAP_ICON, 'icd', $icd, 1, false);
        $sql = "SELECT icd, title FROM {$table_icon} ";
        $result = $xoopsDB->query($sql);
        $icons_array = array();
        $icons_array[0] = '---';
        while ($myrow = $xoopsDB->fetchArray($result)) {
            $icons_array[$myrow['icd']] = $myrow['title'];
        }
        $icon_select->addOptionArray($icons_array);
        $form->addElement($icon_select);
    }
    // Buttons
    $button_tray = new XoopsFormElementTray('', '&nbsp;');
    $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
    $button_tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
    $form->addElement($button_tray);
    // Ticket
    $GLOBALS['xoopsGTicket']->addTicketXoopsFormElement($form, __LINE__);
    // End of XoopsForm
    $form->display();
}