Esempio n. 1
0
 /**
  * created elements
  * @license   http://www.blags.org/
  * @created   :2010年05月21日 20时40分
  * @copyright 1997-2010 The Martin Group
  * @author    Martin <*****@*****.**>
  * */
 public function createElements()
 {
     global $hotel_handler, $xoopsDB, $xoopsModuleConfig;
     //编辑器
     include_once XOOPS_ROOT_PATH . "/modules/martin/class/xoopsformloader.php";
     include_once MARTIN_ROOT_PATH . '/include/formdatetime.php';
     $this->google_api = $xoopsModuleConfig['google_api'];
     /*$this->City = $hotel_handler->GetCityList('WHERE city_parentid = 0');
       $CityElement = new XoopsFormSelect(_AM_MARTIN_HOTEL_CITY, 'hotel_city', $this->Obj->hotel_city() , 1 );
       $CityElement->addOptionArray($this->City);
       $this->addElement($CityElement , true);*/
     $mytree = new XoopsTree($xoopsDB->prefix("martin_hotel_city"), "city_id", "city_parentid");
     // Parent Category
     //multiple
     $js = '<script type="text/javascript">
         jQuery(document).ready(function(){
             jQuery("#hotel_city").find("option").each(function(i){
                 var v = jQuery(this).text();
                 if(v.indexOf("----") != -1) jQuery(this).remove();
             });
         });
         </script>';
     ob_start();
     $mytree->makeMySelBox("city_name", "", $this->Obj->hotel_city(), 1, 'hotel_city');
     //makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="")
     $this->addElement(new XoopsFormLabel($js . _AM_MARTIN_ADMIN_AREA . "<br>" . _AM_MARTIN_SELECT_2ND_LEVEL, ob_get_contents()));
     ob_end_clean();
     // Parent Category
     //multiple
     $mytree->_SetMultiple(true);
     $hotel_city_id = explode(',', $this->Obj->hotel_city_id());
     ob_start();
     $mytree->makeMySelBox("city_name", '', $hotel_city_id, 1, 'hotel_city_id[]');
     //makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="");
     $this->addElement(new XoopsFormLabel(_AM_MARTIN_CIRCLE . "<br>" . _AM_MARTIN_SELECT_3RD_LEVEL, ob_get_contents()));
     ob_end_clean();
     // City Name
     //$this->addElement( new XoopsFormText(_AM_MARTIN_ADMIN_CITY_AREA, 'hotel_environment', 50, 255, $this->Obj->hotel_environment()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_RANK, 'hotel_rank', 11, 11, $this->Obj->hotel_rank()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_NAME, 'hotel_name', 50, 255, $this->Obj->hotel_name()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_NAME_ENGLISH, 'hotel_enname', 50, 255, $this->Obj->hotel_enname()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_WEBSITE . "<br>" . _AM_MARTIN_NO_HTML, 'hotel_alias', 50, 255, $this->Obj->hotel_alias()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_KEYWORDS_SEO, 'hotel_keywords', 50, 255, $this->Obj->hotel_keywords()), true);
     $this->addElement(new XoopsFormTextArea(_AM_MARTIN_HOTEL_DESC_SEO, 'hotel_description', $this->Obj->hotel_description()), true);
     //hotel tags
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTELS_TAGS . "<br>" . _AM_MARTIN_USE_SPACE_AS_SEPARATOR, 'hotel_tags', 50, 255, $this->Obj->hotel_tags()), true);
     //hotel star
     $rankElement = new XoopsFormSelect(_AM_MARTIN_RANK, 'hotel_star', $this->Obj->hotel_star(), 1);
     $rankElement->addOptionArray($this->Ranks);
     $this->addElement($rankElement, true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_ADDRESS, 'hotel_address', 50, 255, $this->Obj->hotel_address()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_PHONE, 'hotel_telephone', 50, 255, $this->Obj->hotel_telephone()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_FAX, 'hotel_fax', 50, 255, $this->Obj->hotel_fax()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_FEATURES, 'hotel_characteristic', 50, 255, $this->Obj->hotel_characteristic()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_THE_NUMBER_OF_ROOMS, 'hotel_room_count', 11, 11, $this->Obj->hotel_room_count()), true);
     $open_time = $this->Obj->hotel_open_time();
     $this->addElement(new XoopsFormText(_AM_MARTIN_HOTEL_OPENED, 'hotel_open_time', 50, 255, date('Y', $open_time > 0 ? $open_time : time())), true);
     //        $this->addElement( new XoopsFormText(_AM_MARTIN_HOTEL_ROOM_PHOTOS, 'hotel_image', 50, 255, $this->Obj->hotel_image()), true);
     list($width, $height) = getimagesize('../images/hotelicon/' . $this->Obj->hotel_icon());
     $hotel_icon = '<script type="text/javascript">
                     function showbox(src)
                     {
                         window.open(src , "_blank" , "width = \' . $width . \',height = \' . $height . \'");
                     }
                     </script>';
     //Hotel Logo
     $hotel_icon .= '<a href = "javascript:void(0);" onclick = "showbox(\'../images/hotelicon/' . $this->Obj->hotel_icon() . '\')"><img src = "../images/hotelicon/' . $this->Obj->hotel_icon() . '" width = 100 height = 100 class="showicon" ></a><br > ';
     $hotelIcon = new XoopsFormElementTray(_AM_MARTIN_HOTEL_LOGO_IMAGE);
     $hotelIcon->addElement(new XoopsFormFile("" . $hotel_icon, "hotel_icon", ""), false);
     $this->addElement($hotelIcon, false);
     //特殊处理
     //酒店地图
     $Coordinate = $this->Obj->hotel_google();
     $google = new XoopsFormElementTray(_AM_MARTIN_GOOGLE_MAP);
     $google->addElement(new XoopsFormText(_AM_MARTIN_LATITTUDE, 'GmapLatitude', 25, 25, $Coordinate[0]), true);
     $google->addElement(new XoopsFormText(_AM_MARTIN_LONGITUDE, 'GmapLongitude', 25, 25, $Coordinate[1]), true);
     $google->addElement(new XoopsFormLabel("<br><br><font style='background - color:#2F5376;color:#FFFFFF;padding:2px;vertical-align:middle;'>google map:</font><br>", $this->googleMap($Coordinate)));
     //酒店图片
     $Img = new XoopsFormElementTray(_AM_MARTIN_HOTEL_PHOTOS);
     $Img->addElement(new XoopsFormLabel("", $this->Swfupload()));
     $this->addElement($Img);
     $this->addElement($google, true);
     //特殊处理
     //编辑器 酒店详细信息
     $this->addElement(new XoopsFormTextArea(_AM_MARTIN_HOTELS_NOTES, 'hotel_reminded', $this->Obj->hotel_reminded()), true);
     //hotel Facility
     $this->addElement(new XoopsFormTextArea(_AM_MARTIN_FACILITIES_SERVICES, 'hotel_facility', $this->Obj->hotel_facility()), true);
     $editor = 'tinymce';
     $hotel_info = $this->Obj->hotel_info();
     $editor_configs = array();
     $editor_configs["name"] = "hotel_info";
     $editor_configs["value"] = $hotel_info;
     $editor_configs["rows"] = empty($xoopsModuleConfig["editor_rows"]) ? 35 : $xoopsModuleConfig["editor_rows"];
     $editor_configs["cols"] = empty($xoopsModuleConfig["editor_cols"]) ? 60 : $xoopsModuleConfig["editor_cols"];
     $editor_configs["width"] = empty($xoopsModuleConfig["editor_width"]) ? "100%" : $xoopsModuleConfig["editor_width"];
     $editor_configs["height"] = empty($xoopsModuleConfig["editor_height"]) ? "400px" : $xoopsModuleConfig["editor_height"];
     $this->addElement(new XoopsFormEditor(_AM_MARTIN_HOTEL_DETALS, $editor, $editor_configs, false, $onfailure = null), false);
     //$this->addElement(new XoopsFormHidden("hotel_info", $hotel_info) , true );
     $this->addElement(new XoopsFormRadioYN(_AM_MARTIN_HOTEL_EDIT_STATUS, 'hotel_status', $this->Obj->hotel_status(), _AM_MARTIN_PUBLISHED, _AM_MARTIN_DRAFT), true);
     //$this->addElement( new MartinFormDateTime("酒店发布时间", 'hotel_open_time', $size = 15, $this->Obj->hotel_open_time() ) ,true);
     $this->addElement(new XoopsFormHidden('hotel_icon_old', $this->Obj->hotel_icon()));
     $this->addElement(new XoopsFormHidden('id', $this->Obj->hotel_id()));
 }
Esempio n. 2
0
    /**
     * created elements
     * @license http://www.blags.org/
     * @created:2010年05月21日 20时40分
     * @copyright 1997-2010 The Martin Group
     * @author Martin <*****@*****.**> 
     * */
    function createElements()
    {
        global $hotel_handler, $xoopsDB, $xoopsModuleConfig;
        //编辑器
        include_once XOOPS_ROOT_PATH . "/modules/martin/class/xoopsformloader.php";
        include_once MARTIN_ROOT_PATH . '/include/formdatetime.php';
        $this->google_api = $xoopsModuleConfig['google_api'];
        /*$this->City = $hotel_handler->GetCityList('WHERE city_parentid = 0');
        		$CityElement = new XoopsFormSelect('酒店城市', 'hotel_city', $this->Obj->hotel_city() , 1 );
        		$CityElement->addOptionArray($this->City);
        		$this->addElement($CityElement , true);*/
        $mytree = new XoopsTree($xoopsDB->prefix("martin_hotel_city"), "city_id", "city_parentid");
        // Parent Category
        //multiple
        $js = '<script type="text/javascript">
			jQuery(document).ready(function(){
				jQuery("#hotel_city").find("option").each(function(i){
					var v = jQuery(this).text();
					if(v.indexOf("----") != -1) jQuery(this).remove();
				});
			});
			</script>';
        ob_start();
        $mytree->makeMySelBox("city_name", "", $this->Obj->hotel_city(), 1, 'hotel_city');
        //makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="")
        $this->addElement(new XoopsFormLabel($js . "行政区<br>选择第二级别", ob_get_contents()));
        ob_end_clean();
        // Parent Category
        //multiple
        $mytree->_SetMultiple(true);
        $hotel_city_id = explode(',', $this->Obj->hotel_city_id());
        ob_start();
        $mytree->makeMySelBox("city_name", "", $hotel_city_id, 1, 'hotel_city_id[]');
        //makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="")
        $this->addElement(new XoopsFormLabel("商圈<br>选择第三级别", ob_get_contents()));
        ob_end_clean();
        // City Name
        //$this->addElement( new XoopsFormText('酒店周边环境', 'hotel_environment', 50, 255, $this->Obj->hotel_environment()), true);
        $this->addElement(new XoopsFormText('酒店排序', 'hotel_rank', 11, 11, $this->Obj->hotel_rank()), true);
        $this->addElement(new XoopsFormText('酒店名称', 'hotel_name', 50, 255, $this->Obj->hotel_name()), true);
        $this->addElement(new XoopsFormText('酒店英文名称', 'hotel_enname', 50, 255, $this->Obj->hotel_enname()), true);
        $this->addElement(new XoopsFormText('酒店网址<br>不需要加[.html]', 'hotel_alias', 50, 255, $this->Obj->hotel_alias()), true);
        $this->addElement(new XoopsFormText('酒店关键字(SEO)', 'hotel_keywords', 50, 255, $this->Obj->hotel_keywords()), true);
        $this->addElement(new XoopsFormTextArea('酒店描述(SEO)', 'hotel_description', $this->Obj->hotel_description()), true);
        //hotel tags
        $this->addElement(new XoopsFormText('酒店tag标签<br>使用空格隔开', 'hotel_tags', 50, 255, $this->Obj->hotel_tags()), true);
        //hotel star
        $rankElement = new XoopsFormSelect('酒店星级', 'hotel_star', $this->Obj->hotel_star(), 1);
        $rankElement->addOptionArray($this->Ranks);
        $this->addElement($rankElement, true);
        $this->addElement(new XoopsFormText('酒店地址', 'hotel_address', 50, 255, $this->Obj->hotel_address()), true);
        $this->addElement(new XoopsFormText('酒店电话', 'hotel_telephone', 50, 255, $this->Obj->hotel_telephone()), true);
        $this->addElement(new XoopsFormText('酒店 FAX', 'hotel_fax', 50, 255, $this->Obj->hotel_fax()), true);
        $this->addElement(new XoopsFormText('酒店特色', 'hotel_characteristic', 50, 255, $this->Obj->hotel_characteristic()), true);
        $this->addElement(new XoopsFormText('酒店房间数', 'hotel_room_count', 11, 11, $this->Obj->hotel_room_count()), true);
        $open_time = $this->Obj->hotel_open_time();
        $this->addElement(new XoopsFormText('酒店开业时间', 'hotel_open_time', 50, 255, date('Y', $open_time > 0 ? $open_time : time())), true);
        //$this->addElement( new XoopsFormText('酒店房图片', 'hotel_image', 50, 255, $this->Obj->hotel_image()), true);
        list($width, $height) = getimagesize('../images/hotelicon/' . $this->Obj->hotel_icon());
        $hotel_icon = '<script type="text/javascript">
						function showbox(src)
						{
							window.open(src , "_blank" , "width=' . $width . ',height=' . $height . '");
						}
						</script>"';
        //酒店标志
        $hotel_icon .= '<a href="javascript:void(0);" onclick="showbox(\'../images/hotelicon/' . $this->Obj->hotel_icon() . '\')"><img src="../images/hotelicon/' . $this->Obj->hotel_icon() . '" width=100 height=100 class="showicon"></a><br>';
        $hotelIcon = new XoopsFormElementTray('酒店标志图片');
        $hotelIcon->addElement(new XoopsFormFile("" . $hotel_icon, "hotel_icon", ""), false);
        $this->addElement($hotelIcon, false);
        //特殊处理
        //酒店地图
        $Coordinate = $this->Obj->hotel_google();
        $google = new XoopsFormElementTray('google 地图');
        $google->addElement(new XoopsFormText('纬度', 'GmapLatitude', 25, 25, $Coordinate[0]), true);
        $google->addElement(new XoopsFormText('经度', 'GmapLongitude', 25, 25, $Coordinate[1]), true);
        $google->addElement(new XoopsFormLabel("<br><br><font style='background-color:#2F5376;color:#FFFFFF;padding:2px;vertical-align:middle;'>google map:</font><br>", $this->googleMap($Coordinate)));
        //酒店图片
        $Img = new XoopsFormElementTray('酒店图片');
        $Img->addElement(new XoopsFormLabel("", $this->Swfupload()));
        $this->addElement($Img);
        $this->addElement($google, true);
        //特殊处理
        //编辑器 酒店详细信息
        $this->addElement(new XoopsFormTextArea('酒店特别提醒', 'hotel_reminded', $this->Obj->hotel_reminded()), true);
        //hotel Facility
        $this->addElement(new XoopsFormTextArea('酒店设施与服务', 'hotel_facility', $this->Obj->hotel_facility()), true);
        $editor = 'tinymce';
        $hotel_info = $this->Obj->hotel_info();
        $editor_configs = array();
        $editor_configs["name"] = "hotel_info";
        $editor_configs["value"] = $hotel_info;
        $editor_configs["rows"] = empty($xoopsModuleConfig["editor_rows"]) ? 35 : $xoopsModuleConfig["editor_rows"];
        $editor_configs["cols"] = empty($xoopsModuleConfig["editor_cols"]) ? 60 : $xoopsModuleConfig["editor_cols"];
        $editor_configs["width"] = empty($xoopsModuleConfig["editor_width"]) ? "100%" : $xoopsModuleConfig["editor_width"];
        $editor_configs["height"] = empty($xoopsModuleConfig["editor_height"]) ? "400px" : $xoopsModuleConfig["editor_height"];
        $this->addElement(new XoopsFormEditor("酒店详细信息", $editor, $editor_configs, false, $onfailure = null), false);
        //$this->addElement(new XoopsFormHidden("hotel_info", $hotel_info) , true );
        $this->addElement(new XoopsFormRadioYN("酒店编辑状态", 'hotel_status', $this->Obj->hotel_status(), '已发布', '编辑中'), true);
        //$this->addElement( new MartinFormDateTime("酒店发布时间", 'hotel_open_time', $size = 15, $this->Obj->hotel_open_time() ) ,true);
        $this->addElement(new XoopsFormHidden('hotel_icon_old', $this->Obj->hotel_icon()));
        $this->addElement(new XoopsFormHidden('id', $this->Obj->hotel_id()));
    }