本文整理汇总了PHP中XoopsTree::_SetMultiple方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsTree::_SetMultiple方法的具体用法?PHP XoopsTree::_SetMultiple怎么用?PHP XoopsTree::_SetMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsTree
的用法示例。
在下文中一共展示了XoopsTree::_SetMultiple方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createElements
/**
* created elements
* @license http://www.blags.org/
* @created :2010年05月21日 20时40分
* @copyright 1997-2010 The Martin Group
* @author Martin <china.codehome@gmail.com>
* */
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"];
//.........这里部分代码省略.........
示例2: createElements
/**
* created elements
* @license http://www.blags.org/
* @created:2010年05月21日 20时40分
* @copyright 1997-2010 The Martin Group
* @author Martin <china.codehome@gmail.com>
* */
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"];
//.........这里部分代码省略.........