$navbarMain = $this->app->db->prepareFetchAssocAll("SELECT * FROM `fox_admin_navbar` WHERE `parent_id` = ''");
$navbar = array();
for($i=0; $i<count($navbarMain); $i++) {
$id = $navbarMain[$i]['id'];
$name = $navbarMain[$i]['name'];
$parentId = $navbarMain[$i]['parent_id'];
$icon = $navbarMain[$i]['icon'];
$link = $navbarMain[$i]['link'];
$navbarChild = $this->app->db->prepareFetchAssocAll("SELECT * FROM `fox_admin_navbar` WHERE `parent_id` = ?", array($id));
$childData = array();
if($navbarChild) {
for($x=0; $x<count($navbarChild); $x++) {
$childId = $navbarChild[$x]['id'];
$childName = $navbarChild[$x]['name'];
$childIcon = $navbarChild[$x]['icon'];
$childLink = $navbarChild[$x]['link'];
$child = array(
$x => array(
'id' => $childId,
'name' => $childName,
'icon' => $childIcon,
'link' => $childLink
)
);
$childData = array_merge($childData, $child);
}
} else { $childData = ''; }
$data = array(
$i => array(
'id' => $id,
'name' => $name,
'childs' => $childData,
'icon' => $icon,
'link' => $link
)
);
$navbar = array_merge($navbar, $data);
}
$this->pageMacros = array_merge($this->pageMacros, array('navbar' => $navbar));
<p>{{ phrase('user_email_confirmation_body_html')|replace({'%username%': 'Evgen', '%board%': option('board_title') })|raw }}</p>
<p>{{ phrase('user_email_confirmation_body_html') |replace({'%username%': 'Evgen', '%board%': option('board_title') }) }}</p>
public function phrase($phrase, $language = 0) {
$defaultLanguage = $this->option('board_language');
if ($language == 0) { $language = $defaultLanguage; }
$data = $this->db->prepareFetchAssocAll('SELECT * FROM `fox_language` WHERE language_code = ?', array($language));
foreach ($data as $key => $val) {
if($val['phrase_code'] == $phrase) {
return $val['phrase_text'];
}
}
}
<b>Evgen, для завершения регистрации на сайте FoxTech, Вам необходимо подтвердить свою учетную запись, перейдя по ссылке ниже.</b>
public function phrase($phrase, $language = 0) {
$defaultLanguage = $this->option('board_language');
if ($language == 0) { $language = $defaultLanguage; }
$data = $this->db->prepareFetchAssocAll('SELECT * FROM `fox_language` WHERE language_code = ?', array($language));
foreach ($data as $key => $val) {
if($val['phrase_code'] == $phrase) {
echo $val['phrase_text'];
}
}
}
public function phrase($phrase, $language = 0) {
$defaultLanguage = $this->option('board_language');
if ($language == 0) { $language = $defaultLanguage; }
$this->db = new DataBase;
$data = $this->db->prepareFetchAssoc('SELECT `phrase_text` FROM `fox_language` WHERE phrase_code = ? AND language_code = ?', array($phrase, $language));
if ($data['phrase_text']) {
return $data['phrase_text'];
} else {
return $phrase;
}
}