本文整理汇总了PHP中menu::restore方法的典型用法代码示例。如果您正苦于以下问题:PHP menu::restore方法的具体用法?PHP menu::restore怎么用?PHP menu::restore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu
的用法示例。
在下文中一共展示了menu::restore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'" . $menu_uuid . "', ";
$sql .= "'{$menu_name}', ";
$sql .= "'{$menu_language}', ";
$sql .= "'{$menu_description}' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
//add the menu items
require_once "resources/classes/menu.php";
$menu = new menu();
$menu->db = $db;
$menu->menu_uuid = $menu_uuid;
$menu->restore();
unset($menu);
if ($display_type == "text") {
echo "\tMenu:\t\t\tadded\n";
}
}
unset($prep_statement, $sub_result);
}
//if there are no groups listed in v_menu_item_groups then add the default groups
if ($domains_processed == 1) {
$sql = "SELECT * FROM v_menus ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
foreach ($result as $field) {
示例2: create_menus
protected function create_menus()
{
$this->write_progress("\tCreating menus");
//set the defaults
$menu_name = 'default';
$menu_language = 'en-us';
$menu_description = 'Default Menu Set';
$this->write_progress("\tChecking if menu exists");
$sql = "select count(*) from v_menus ";
$sql .= "where menu_uuid = '" . $this->menu_uuid . "' ";
$sql .= "limit 1 ";
$this->write_debug($sql);
$prep_statement = $this->dbh->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetch(PDO::FETCH_NAMED);
unset($sql, $prep_statement);
if ($result['count'] == 0) {
$this->write_progress("\t... creating menu '" . $menu_name . "'");
$sql = "insert into v_menus ";
$sql .= "(";
$sql .= "menu_uuid, ";
$sql .= "menu_name, ";
$sql .= "menu_language, ";
$sql .= "menu_description ";
$sql .= ") ";
$sql .= "values ";
$sql .= "(";
$sql .= "'" . $this->menu_uuid . "', ";
$sql .= "'{$menu_name}', ";
$sql .= "'{$menu_language}', ";
$sql .= "'{$menu_description}' ";
$sql .= ");";
if ($this->debug) {
$this->write_debug($sql . "\n");
}
$this->dbh->exec(check_sql($sql));
unset($sql);
//add the menu items
require_once "resources/classes/menu.php";
$menu = new menu();
$menu->db = $this->dbh;
$menu->menu_uuid = $this->menu_uuid;
$menu->restore();
unset($menu);
}
}