本文整理汇总了PHP中CMenu::get_id_first_element方法的典型用法代码示例。如果您正苦于以下问题:PHP CMenu::get_id_first_element方法的具体用法?PHP CMenu::get_id_first_element怎么用?PHP CMenu::get_id_first_element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMenu
的用法示例。
在下文中一共展示了CMenu::get_id_first_element方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($http_request = '') {
$this->http_request = $http_request;
if(!empty($http_request['m'])) {
$id_element_cible = $http_request['m'];
$this->nom_zone_cible = "menu";
}
elseif(!empty($http_request['s'])) {
$id_element_cible = $http_request['s'];
$this->nom_zone_cible = "sousmenu";
}
elseif(!empty($http_request['p'])) {
$id_element_cible = $http_request['p'];
$this->nom_zone_cible = "page";
}
elseif(!empty($http_request['v'])) {
$id_element_cible = $http_request['v'];
$this->nom_zone_cible = "video";
}
elseif(!empty($http_request['g'])) {
$id_element_cible = $http_request['g'];
$this->nom_zone_cible = "galerie";
}
else {
$cible_objet = new CMenu();
$id_element_cible = $cible_objet->get_id_first_element();
$this->nom_zone_cible= 'menu';
}
switch($this->nom_zone_cible) {
case 'menu' :
$this->id_menu_courant = $id_element_cible;
$sousmenu_objet = new CSousmenu();
$page_objet = new CPage();
$this->id_sousmenu_courant = $sousmenu_objet->get_id_first_element($this->id_menu_courant);
$this->id_page_courant = $page_objet->get_id_first_element($this->id_sousmenu_courant);
break;
case 'sousmenu' :
$this->id_sousmenu_courant = $id_element_cible;
$page_objet = new CPage();
$sousmenu_objet = new CSousMenu();
$this->id_page_courant = $page_objet->get_id_first_element($this->id_sousmenu_courant);
$this->id_menu_courant = $sousmenu_objet->get_id_element_parent($this->id_sousmenu_courant);
break;
case 'page' :
$this->id_page_courant = $id_element_cible;
$page_objet = new CPage();
$sousmenu_objet = new CSousmenu();
$this->id_sousmenu_courant = $page_objet->get_id_element_parent($this->id_page_courant);
$this->id_menu_courant = $sousmenu_objet->get_id_element_parent($this->id_sousmenu_courant);
break;
case 'galerie' :
$this->id_galerie_courant = $id_element_cible;
$sql = "SELECT idpage FROM galerie WHERE id = " . $id_element_cible ;
$id_page = CBdd::select_one($sql, 'idpage');
$this->id_page_courant = $id_page;
$page_objet = new CPage();
$sousmenu_objet = new CSousmenu();
$this->id_sousmenu_courant = $page_objet->get_id_element_parent($this->id_page_courant);
$this->id_menu_courant = $sousmenu_objet->get_id_element_parent($this->id_sousmenu_courant);
break;
case 'video' :
$this->id_video_courant = $id_element_cible;
$sql = "SELECT id_page FROM video WHERE id = " . $id_element_cible ;
$id_page = CBdd::select_one($sql, 'id_page');
$this->id_page_courant = $id_page;
$page_objet = new CPage();
$sousmenu_objet = new CSousmenu();
$this->id_sousmenu_courant = $page_objet->get_id_element_parent($this->id_page_courant);
$this->id_menu_courant = $sousmenu_objet->get_id_element_parent($this->id_sousmenu_courant);
break;
}
}