本文整理匯總了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"];
//.........這裏部分代碼省略.........